]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Models/Entity.php
Guest create page: name field autofocus
[bookstack] / app / Entities / Models / Entity.php
index a5254875d5f40b7db97e8e173d2a1c05dab6714e..8bfe69365ef47e529de6178a03f9e3fe72d80781 100644 (file)
@@ -42,7 +42,6 @@ use Illuminate\Database\Eloquent\SoftDeletes;
  * @property Carbon     $deleted_at
  * @property int        $created_by
  * @property int        $updated_by
- * @property bool       $restricted
  * @property Collection $tags
  *
  * @method static Entity|Builder visible()
@@ -182,12 +181,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;
     }
 
     /**