mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Standardised admin role check
This commit is contained in:
@ -115,9 +115,9 @@ class UserRepo
|
||||
*/
|
||||
public function isOnlyAdmin(User $user)
|
||||
{
|
||||
if (!$user->roles->pluck('name')->contains('admin')) return false;
|
||||
if (!$user->hasSystemRole('admin')) return false;
|
||||
|
||||
$adminRole = $this->role->getRole('admin');
|
||||
$adminRole = $this->role->getSystemRole('admin');
|
||||
if ($adminRole->users->count() > 1) return false;
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user