Skip to content
Snippets Groups Projects
Commit 236ac986 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #11765 TIME 0:30 create/delete private opinion circuit templates

parent 5b3d6db6
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,10 @@ class ListTemplateController
&& !PrivilegeController::hasPrivilege(['privilegeId' => 'config_visa_workflow', 'userId' => $GLOBALS['id']])) {
return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']);
}
if ($body['type'] == 'opinionCircuit'
&& !PrivilegeController::hasPrivilege(['privilegeId' => 'config_avis_workflow', 'userId' => $GLOBALS['id']])) {
return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']);
}
$owner = $GLOBALS['id'];
}
......@@ -257,7 +261,7 @@ class ListTemplateController
if (empty($listTemplate)) {
return $response->withStatus(400)->withJson(['errors' => 'List template not found']);
}
if (empty($listTemplate['owner']) && $listTemplate['type'] != 'visaCircuit' ) {
if (empty($listTemplate['owner']) && ($listTemplate['type'] != 'visaCircuit' || $listTemplate['type'] != 'opinionCircuit') ) {
if (!PrivilegeController::hasPrivilege(['privilegeId' => 'manage_entities', 'userId' => $GLOBALS['id']]) && !empty($listTemplate['entityId'])) {
return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']);
}
......
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