This commit is contained in:
Yuri Kuznetsov
2021-04-03 17:57:02 +03:00
parent 304d63c6a2
commit 4cbcddf3c0
2 changed files with 19 additions and 1 deletions
+6
View File
@@ -188,6 +188,8 @@ class Acl
/**
* Get attributes forbidden for a user.
*
* @return array<string>
*/
public function getScopeForbiddenAttributeList(
string $scope,
@@ -201,6 +203,8 @@ class Acl
/**
* Get fields forbidden for a user.
*
* @return array<string>
*/
public function getScopeForbiddenFieldList(
string $scope,
@@ -214,6 +218,8 @@ class Acl
/**
* Get links forbidden for a user.
*
* @return array<string>
*/
public function getScopeForbiddenLinkList(
string $scope,
+13 -1
View File
@@ -36,11 +36,12 @@ use Espo\Entities\User;
use Espo\Core\{
ORM\EntityManager,
Acl\AclFactory,
Acl\ScopeAcl,
Acl\GlobalRestrictonFactory,
Acl\GlobalRestricton,
Acl as UserAclWrapper,
Acl\Table as Table,
Acl\ScopeAcl,
Acl\EntityAcl,
Acl\EntityCreateAcl,
Acl\EntityReadAcl,
Acl\EntityEditAcl,
@@ -49,6 +50,7 @@ use Espo\Core\{
};
use StdClass;
use RuntimeException;
/**
* Used to check access for a specific user.
@@ -229,6 +231,10 @@ class AclManager
return $impl->$methodName($user, $entity, $data);
}
if (!$impl instanceof EntityAcl) {
throw new RuntimeException("Acl must implement EntityAcl interface.");
}
if (method_exists($impl, $methodName)) {
// For backward compatibility.
return $impl->$methodName($user, $entity, $data);
@@ -374,6 +380,8 @@ class AclManager
/**
* Get attributes forbidden for a user.
*
* @return array<string>
*/
public function getScopeForbiddenAttributeList(
User $user,
@@ -405,6 +413,8 @@ class AclManager
/**
* Get fields forbidden for a user.
*
* @return array<string>
*/
public function getScopeForbiddenFieldList(
User $user,
@@ -436,6 +446,8 @@ class AclManager
/**
* Get links forbidden for a user.
*
* @return array<string>
*/
public function getScopeForbiddenLinkList(
User $user,