mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
Formula relate write access check
This commit is contained in:
@@ -123,6 +123,10 @@ class RelateType extends BaseFunction implements
|
||||
{
|
||||
$restriction = $this->injectableFactory->create(SystemRestriction::class);
|
||||
|
||||
if (!$restriction->checkEntityTypeWrite($entityType)) {
|
||||
throw new NotAllowedUsage("Cannot write '$entityType'.");
|
||||
}
|
||||
|
||||
if (!$restriction->checkLinkWrite($entityType, $link) ) {
|
||||
throw new NotAllowedUsage("Cannot write restricted link $entityType.$link.");
|
||||
}
|
||||
|
||||
@@ -99,6 +99,10 @@ class UnrelateType extends BaseFunction implements
|
||||
{
|
||||
$restriction = $this->injectableFactory->create(SystemRestriction::class);
|
||||
|
||||
if (!$restriction->checkEntityTypeWrite($entityType)) {
|
||||
throw new NotAllowedUsage("Cannot write '$entityType'.");
|
||||
}
|
||||
|
||||
if (!$restriction->checkLinkWrite($entityType, $link) ) {
|
||||
throw new NotAllowedUsage("Cannot write restricted link $entityType.$link.");
|
||||
}
|
||||
|
||||
@@ -111,6 +111,10 @@ class UpdateRelationColumnType extends BaseFunction implements
|
||||
{
|
||||
$restriction = $this->injectableFactory->create(SystemRestriction::class);
|
||||
|
||||
if (!$restriction->checkEntityTypeWrite($entityType)) {
|
||||
throw new NotAllowedUsage("Cannot write '$entityType'.");
|
||||
}
|
||||
|
||||
if (!$restriction->checkLinkWrite($entityType, $link) ) {
|
||||
throw new NotAllowedUsage("Cannot write restricted link $entityType.$link.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user