Add a specific role to SAML user

This commit is contained in:
Jan Böhmer 2023-02-21 00:42:03 +01:00
parent 97c3b9002a
commit 60f926924b

View file

@ -306,6 +306,10 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
// guarantee every user at least has ROLE_USER // guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER'; $roles[] = 'ROLE_USER';
if ($this->saml_user) {
$roles[] = 'ROLE_SAML_USER';
}
return array_unique($roles); return array_unique($roles);
} }