selectAccessControlDisabled

This commit is contained in:
Yuri Kuznetsov
2023-07-20 09:50:24 +03:00
parent 50c208e4db
commit 7f8a152909
2 changed files with 9 additions and 10 deletions
+4 -9
View File
@@ -141,8 +141,6 @@ class Service implements Crud,
protected $nonAdminReadOnlyLinkList = [];
/** @var string[] */
protected $onlyAdminLinkList = [];
/** @var array<string, array<string, mixed>> */
protected $linkParams = [];
/** @var array<string, string[]> */
protected $linkMandatorySelectAttributeList = [];
/** @var string[] */
@@ -966,14 +964,11 @@ class Service implements Crud,
->getRelation($link)
->getForeignEntityType();
$linkParams = $this->linkParams[$link] ?? [];
$skipAcl = $this->metadata
->get("recordDefs.$this->entityType.relationships.$link.selectAccessControlDisabled") ?? false;
$skipAcl = $linkParams['skipAcl'] ?? false;
if (!$skipAcl) {
if (!$this->acl->check($foreignEntityType, AclTable::ACTION_READ)) {
throw new Forbidden();
}
if (!$skipAcl && !$this->acl->check($foreignEntityType, AclTable::ACTION_READ)) {
throw new Forbidden();
}
$recordService = $this->recordServiceContainer->get($foreignEntityType);
+5 -1
View File
@@ -101,6 +101,10 @@
"additionalProperties": {
"type": "object",
"properties": {
"selectAccessControlDisabled": {
"description": "Disable access control when listing related records; only access to a parent record will be checked.",
"type": "boolean"
},
"linkRequiredAccess": {
"description": "Access to a current record that is needed to be able to link and unlink records.",
"type": "string",
@@ -116,7 +120,7 @@
"type": "boolean"
},
"linkCheckDisabled": {
"description": "Disable a link-check functionallity linking through link-multiple field.",
"description": "Disable a link-check functionality when linking through link-multiple field.",
"type": "boolean"
}
}