diff --git a/src/app/entity/controllers/ListTemplateController.php b/src/app/entity/controllers/ListTemplateController.php index 3a0a6b09aaf0e91aea92ab0d2341702303fd1c21..a3da75d56371575b18d9d7cf05d592e82a094a8a 100755 --- a/src/app/entity/controllers/ListTemplateController.php +++ b/src/app/entity/controllers/ListTemplateController.php @@ -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']); }