diff --git a/src/Core/Models/User.php b/src/Core/Models/User.php index c9d9f8972..902c11013 100755 --- a/src/Core/Models/User.php +++ b/src/Core/Models/User.php @@ -311,9 +311,13 @@ class User extends Model return true; } - $count = $this->permissions()->where('permission', $permission)->count(); + static $permissions; - return (bool) $count; + if (!$permissions) { + $permissions = $this->permissions()->get(); + } + + return (bool) $permissions->contains('permission', $permission); } public function getUnreadNotificationsCount()