feat: adjust oauth2 implementation for TYPO3 backend login
This commit is contained in:
@@ -117,9 +117,12 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
|
||||
|
||||
private function collectRoles(CrmAttributes $crmAttributes): array
|
||||
{
|
||||
// Collect user's roles from CRM attributes
|
||||
$roles = [];
|
||||
// All users inherit the default role 'customer'
|
||||
$roles = [
|
||||
'ROLE_CUSTOMER',
|
||||
];
|
||||
|
||||
// Get user's base role from CRM attributes
|
||||
if ($crmAttributes->admin) {
|
||||
$roles[] = 'ROLE_ADMIN';
|
||||
} elseif ($crmAttributes->manager) {
|
||||
@@ -128,6 +131,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
|
||||
$roles[] = 'ROLE_HOUSE_MANAGER';
|
||||
}
|
||||
|
||||
// All users can have role 'teamer' additionally
|
||||
if ($crmAttributes->teamer) {
|
||||
$roles[] = 'ROLE_TEAMER';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user