1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Updated restricted usage on search and entity meta details

Also removed now unused view.
This commit is contained in:
Dan Brown
2022-10-10 16:22:51 +01:00
parent 803934d020
commit 63056dbef4
7 changed files with 11 additions and 27 deletions

View 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;
}
/**