Merge pull request #9695 from christianmg99/allow-oidc-roles-string

chg: [config] Allow Oidc roles as string
pull/9454/merge
Jakub Onderka 2024-04-22 09:43:06 +02:00 committed by GitHub
commit 536bbb9d92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -443,12 +443,13 @@ class Oidc
}
/**
* @param array $roles Role list provided by OIDC
* @param array|string $roles Role list provided by OIDC
* @param string $mispUsername
* @return int|null Role ID or null if no role matches
*/
private function getUserRole(array $roles, $mispUsername)
private function getUserRole($roles, $mispUsername)
{
$roles = is_string($roles) ? explode($this->getConfig('roles_delimiter', ','), $roles) : $roles;
$this->log($mispUsername, 'Provided roles: ' . implode(', ', $roles));
$roleMapper = $this->getConfig('role_mapper');
if (!is_array($roleMapper)) {