Port entity policy changes to view() policy
This commit is contained in:
parent
20f398d49b
commit
5de7d09541
1 changed files with 1 additions and 1 deletions
|
|
@ -64,7 +64,7 @@ class EntityPolicy
|
|||
public function view(User $user, $entity) : bool
|
||||
{
|
||||
return ($user->isAdmin() && $entity->company_id == $user->companyId())
|
||||
|| ($user->hasPermission('view_'.strtolower(class_basename($entity))) && $entity->company_id == $user->companyId())
|
||||
|| ($user->hasPermission('view_'.strtolower(\Illuminate\Support\Str::snake(class_basename($entity)))) && $entity->company_id == $user->companyId())
|
||||
|| ($user->hasPermission('view_all') && $entity->company_id == $user->companyId())
|
||||
|| $user->owns($entity)
|
||||
|| $user->assigned($entity);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue