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

Added user-interface for "Everyone Else" entity permission item

Nothing on back-end logic done to hook this new option up.
Addition of permissions for role_id=0 works out of the box, but active
"everyone else" permissions, with no priviliges, is currently not
working. Needs change of permission gen logic also.
This commit is contained in:
Dan Brown
2022-10-02 18:09:48 +01:00
parent b8b0afa0df
commit a03245e427
10 changed files with 87 additions and 17 deletions

View File

@ -184,8 +184,10 @@ abstract class Entity extends Model implements Sluggable, Favouritable, Viewable
*/
public function hasRestriction(int $role_id, string $action): bool
{
return $this->permissions()->where('role_id', '=', $role_id)
->where('action', '=', $action)->count() > 0;
return $this->permissions()
->where('role_id', '=', $role_id)
->where('action', '=', $action)
->count() > 0;
}
/**