]> BookStack Code Mirror - bookstack/blobdiff - app/Auth/User.php
Implement the renderPages parameter
[bookstack] / app / Auth / User.php
index 40718beb6bfdccc1f7fb53770c7600fffd43b2ed..f65ef5316f67bfe3c68f40a6e2f7925ac7aa8f27 100644 (file)
@@ -101,12 +101,10 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
 
     /**
      * Check if the user has a role.
-     * @param $role
-     * @return mixed
      */
-    public function hasRole($role)
+    public function hasRole($roleId): bool
     {
-        return $this->roles->pluck('name')->contains($role);
+        return $this->roles->pluck('id')->contains($roleId);
     }
 
     /**
@@ -163,7 +161,6 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
 
     /**
      * Attach a role to this user.
-     * @param Role $role
      */
     public function attachRole(Role $role)
     {