]> BookStack Code Mirror - bookstack/blobdiff - app/User.php
Finished refactor of entity repos
[bookstack] / app / User.php
index 09b189cbb55e084419309c3b6f154e77ed28d4ee..b5bb221e8652a29a2e8dbb19d84ac40799498bd8 100644 (file)
@@ -74,6 +74,16 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
         return $this->roles->pluck('name')->contains($role);
     }
 
+    /**
+     * Check if the user has a role.
+     * @param $role
+     * @return mixed
+     */
+    public function hasSystemRole($role)
+    {
+        return $this->roles->pluck('system_name')->contains('admin');
+    }
+
     /**
      * Get all permissions belonging to a the current user.
      * @param bool $cache