1
0
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:
Dan Brown
2017-12-29 16:14:20 +00:00
parent 3eb2246291
commit 0c1b1cd435
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}