Skip to content
Snippets Groups Projects
Verified Commit 8b4b1d24 authored by Damien's avatar Damien
Browse files

FEAT #10741 TIME 0:10 Set action control if substituted

parent e29a431b
No related branches found
No related tags found
No related merge requests found
...@@ -348,6 +348,11 @@ class DocumentController ...@@ -348,6 +348,11 @@ class DocumentController
return $response->withStatus(403)->withJson(['errors' => 'Document out of perimeter']); return $response->withStatus(403)->withJson(['errors' => 'Document out of perimeter']);
} }
$currentUser = UserModel::getById(['id' => $GLOBALS['id'], 'select' => ['substitute']]);
if (!empty($currentUser['substitute'])) {
return $response->withStatus(403)->withJson(['errors' => 'User can not make action with substituted account']);
}
if (empty(DocumentController::ACTIONS[$args['actionId']])) { if (empty(DocumentController::ACTIONS[$args['actionId']])) {
return $response->withStatus(400)->withJson(['errors' => 'Action does not exist']); return $response->withStatus(400)->withJson(['errors' => 'Action does not exist']);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment