mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-04 00:44:41 +08:00
Improved permission regen performance by factor of 4
Worked around slower eloquent access to speed up permission generation.
This commit is contained in:
@ -82,8 +82,7 @@ abstract class Entity extends Ownable
|
||||
*/
|
||||
public function hasActiveRestriction($role_id, $action)
|
||||
{
|
||||
return $this->restricted && $this->restrictions()
|
||||
->where('role_id', '=', $role_id)->where('action', '=', $action)->count() > 0;
|
||||
return $this->getRawAttribute('restricted') && $this->hasRestriction($role_id, $action);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user