validation before check create access
This commit is contained in:
@@ -810,14 +810,10 @@ class Service implements Crud,
|
||||
$this->sanitizeInput($data);
|
||||
|
||||
$entity->set($data);
|
||||
|
||||
$this->populateDefaults($entity, $data);
|
||||
|
||||
if (!$this->acl->check($entity, AclTable::ACTION_CREATE)) {
|
||||
throw new ForbiddenSilent("No create access.");
|
||||
}
|
||||
|
||||
$this->processValidation($entity, $data);
|
||||
$this->checkEntityCreateAccess($entity);
|
||||
$this->processAssignmentCheck($entity);
|
||||
$this->getLinkCheck()->processFields($entity);
|
||||
|
||||
@@ -2047,4 +2043,14 @@ class Service implements Crud,
|
||||
|
||||
return $this->recordHookManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Forbidden
|
||||
*/
|
||||
private function checkEntityCreateAccess(Entity $entity): void
|
||||
{
|
||||
if (!$this->acl->check($entity, AclTable::ACTION_CREATE)) {
|
||||
throw new ForbiddenSilent("No create access.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user