Improved permission regen performance by factor of 4

Worked around slower eloquent access to speed up permission generation.
This commit is contained in:
Dan Brown
2016-04-30 17:16:06 +01:00
parent 9a31b83b2a
commit 59367b3417
16 changed files with 49 additions and 60 deletions

View File

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