view user access for acl entities

This commit is contained in:
Yuri Kuznetsov
2025-03-05 09:50:17 +02:00
parent a3e7f5c5fa
commit 3847afc50f
2 changed files with 9 additions and 3 deletions
@@ -93,8 +93,11 @@ class UsersAccessService
throw new Forbidden("No access for portal user.");
}
if (!$this->metadata->get("scopes.{$entity->getEntityType()}.object")) {
throw new Forbidden("Non-object entity.");
if (
!$this->metadata->get("scopes.{$entity->getEntityType()}.object") &&
!$this->metadata->get("scopes.{$entity->getEntityType()}.acl")
) {
throw new Forbidden("Non-object entity and non-acl entity.");
}
if (!$this->acl->checkEntityRead($entity)) {
@@ -41,7 +41,10 @@ export default class {
const level = this.view.getAcl().getPermissionLevel('user');
this.toShow = (level === 'all' || level === 'team') &&
this.metadata.get(`scopes.${this.entityType}.object`) &&
(
this.metadata.get(`scopes.${this.entityType}.object`) ||
this.metadata.get(`scopes.${this.entityType}.acl`)
)
this.view.getAcl().checkScope('User');
}