We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1518a82 commit 8a3baf6Copy full SHA for 8a3baf6
1 file changed
src/Auth/AclTrait.php
@@ -524,6 +524,16 @@ protected function _getUserRoles(ArrayAccess|array $user) {
524
throw new CakeException('Invalid TinyAuth config, `roleColumn` config missing.');
525
}
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
537
if (!array_key_exists($roleColumn, (array)$user)) {
538
throw new CakeException(sprintf('Missing TinyAuth role id field (%s) in user session', 'Auth.User.' . $this->getConfig('roleColumn')));
539
0 commit comments