File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -524,6 +524,16 @@ protected function _getUserRoles(ArrayAccess|array $user) {
524
524
throw new CakeException ('Invalid TinyAuth config, `roleColumn` config missing. ' );
525
525
}
526
526
527
+ // Check if the roleColumn is a dot notation path
528
+ if (str_contains ($ roleColumn , '. ' )) {
529
+ $ role = Hash::get ($ user , $ roleColumn );
530
+ if (!$ role ) {
531
+ throw new CakeException (sprintf ('Missing TinyAuth role id field (%s) in user session ' , 'Auth.User. ' . $ roleColumn ));
532
+ }
533
+
534
+ return $ this ->_mapped ([$ role ]);
535
+ }
536
+
527
537
if (!array_key_exists ($ roleColumn , (array )$ user )) {
528
538
throw new CakeException (sprintf ('Missing TinyAuth role id field (%s) in user session ' , 'Auth.User. ' . $ this ->getConfig ('roleColumn ' )));
529
539
}
You can’t perform that action at this time.
0 commit comments