mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for policies
This commit is contained in:
parent
b72222c3c7
commit
c1ac1647f6
@ -49,8 +49,8 @@ class EntityPolicy
|
|||||||
return ($user->isAdmin() && $entity->company_id == $user->companyId())
|
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_'.strtolower(\Illuminate\Support\Str::snake(class_basename($entity)))) && $entity->company_id == $user->companyId())
|
||||||
|| ($user->hasPermission('edit_all') && $entity->company_id == $user->companyId())
|
|| ($user->hasPermission('edit_all') && $entity->company_id == $user->companyId())
|
||||||
|| $user->owns($entity)
|
|| ($user->owns($entity) && $entity->company_id == $user->companyId())
|
||||||
|| $user->assigned($entity);
|
|| ($user->assigned($entity) && $entity->company_id == $user->companyId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,7 +66,7 @@ class EntityPolicy
|
|||||||
return ($user->isAdmin() && $entity->company_id == $user->companyId())
|
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_'.strtolower(\Illuminate\Support\Str::snake(class_basename($entity)))) && $entity->company_id == $user->companyId())
|
||||||
|| ($user->hasPermission('view_all') && $entity->company_id == $user->companyId())
|
|| ($user->hasPermission('view_all') && $entity->company_id == $user->companyId())
|
||||||
|| $user->owns($entity)
|
|| ($user->owns($entity) && $entity->company_id == $user->companyId())
|
||||||
|| $user->assigned($entity);
|
|| ($user->assigned($entity) && $entity->company_id == $user->companyId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user