Allow 2FA for SAML and LDAP users (#4000)
* inline totp image as data uri to prevent caching issues * allow 2fa for ldap and saml users * allow 2FA access for super admin to all profiles
This commit is contained in:
@@ -83,9 +83,8 @@ final class UserVoter extends Voter
|
||||
}
|
||||
|
||||
if ($attribute === '2fa') {
|
||||
// two factor only works for internal users and
|
||||
// can only be activated by the logged-in user for himself
|
||||
return $subject->isInternalUser() && $subject->getId() === $user->getId();
|
||||
// can only be activated by the logged-in user for himself or by a super-admin
|
||||
return $subject->getId() === $user->getId() || $user->isSuperAdmin();
|
||||
}
|
||||
|
||||
$permission = $attribute;
|
||||
|
||||
Reference in New Issue
Block a user