Fixes for policies
This commit is contained in:
parent
b72222c3c7
commit
c1ac1647f6
1 changed files with 4 additions and 4 deletions
|
|
@ -49,8 +49,8 @@ class EntityPolicy
|
|||
return ($user->isAdmin() && $entity->company_id == $user->companyId())
|
||||
|| ($user->hasPermission('edit_'.strtolower(\Illuminate\Support\Str::snake(class_basename($entity)))) && $entity->company_id == $user->companyId())
|
||||
|| ($user->hasPermission('edit_all') && $entity->company_id == $user->companyId())
|
||||
|| $user->owns($entity)
|
||||
|| $user->assigned($entity);
|
||||
|| ($user->owns($entity) && $entity->company_id == $user->companyId())
|
||||
|| ($user->assigned($entity) && $entity->company_id == $user->companyId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,7 +66,7 @@ class EntityPolicy
|
|||
return ($user->isAdmin() && $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);
|
||||
|| ($user->owns($entity) && $entity->company_id == $user->companyId())
|
||||
|| ($user->assigned($entity) && $entity->company_id == $user->companyId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue