]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Models/Entity.php
Updated restricted usage on search and entity meta details
[bookstack] / app / Entities / Models / Entity.php
index a5254875d5f40b7db97e8e173d2a1c05dab6714e..4c399584b3b32366a217836992645f170e086d05 100644 (file)
@@ -182,12 +182,9 @@ abstract class Entity extends Model implements Sluggable, Favouritable, Viewable
     /**
      * Check if this entity has a specific restriction set against it.
      */
-    public function hasRestriction(int $role_id, string $action): bool
+    public function hasPermissions(): bool
     {
-        return $this->permissions()
-                ->where('role_id', '=', $role_id)
-                ->where($action, '=', true)
-                ->count() > 0;
+        return $this->permissions()->count() > 0;
     }
 
     /**