EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
view user access for acl entities
Yuri Kuznetsov3847afc50f73
diff --git a/application/Espo/Tools/User/UsersAccessService.php b/application/Espo/Tools/User/UsersAccessService.phpindex e1e31ff4d1..235a38d402 100644--- a/application/Espo/Tools/User/UsersAccessService.php+++ b/application/Espo/Tools/User/UsersAccessService.php@@ -93,8 +93,11 @@ class UsersAccessServicethrow 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)) {diff --git a/client/src/handlers/record/view-user-access.js b/client/src/handlers/record/view-user-access.jsindex 922e84f59b..7b6c008847 100644--- a/client/src/handlers/record/view-user-access.js+++ b/client/src/handlers/record/view-user-access.js@@ -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');}