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

FEAT #12764 TIME 0:10 fix after code review

parent 7cf443ab
No related branches found
No related tags found
No related merge requests found
...@@ -291,7 +291,7 @@ class EmailController ...@@ -291,7 +291,7 @@ class EmailController
'info' => _EMAIL_REMOVED 'info' => _EMAIL_REMOVED
]); ]);
if (!empty($email['data']['document'])) { if (!empty($email['document'])) {
$document = (array)json_decode($email['document']); $document = (array)json_decode($email['document']);
HistoryController::add([ HistoryController::add([
......
...@@ -49,9 +49,9 @@ class ListTemplateController ...@@ -49,9 +49,9 @@ class ListTemplateController
'data' => $data 'data' => $data
]); ]);
for ($i = 0; $i < count($listTemplates); $i++) { foreach ($listTemplates as $key => $listTemplate) {
$listTemplates[$i]['isPrivate'] = $listTemplates[$i]['owner'] != null; $listTemplates[$key]['isPrivate'] = $listTemplates[$key]['owner'] != null;
unset($listTemplates[$i]['owner']); unset($listTemplates[$key]['owner']);
} }
return $response->withJson(['listTemplates' => $listTemplates]); return $response->withJson(['listTemplates' => $listTemplates]);
...@@ -263,12 +263,12 @@ class ListTemplateController ...@@ -263,12 +263,12 @@ class ListTemplateController
if (empty($listTemplate)) { if (empty($listTemplate)) {
return $response->withStatus(400)->withJson(['errors' => 'List template not found']); return $response->withStatus(400)->withJson(['errors' => 'List template not found']);
} }
if (empty($listTemplate['owner']) && ($listTemplate['type'] != 'visaCircuit' || $listTemplate['type'] != 'opinionCircuit') ) { if (empty($listTemplate['owner'])) {
if (!PrivilegeController::hasPrivilege(['privilegeId' => 'manage_entities', 'userId' => $GLOBALS['id']]) && !empty($listTemplate['entityId'])) { if (!PrivilegeController::hasPrivilege(['privilegeId' => 'manage_entities', 'userId' => $GLOBALS['id']]) && !empty($listTemplate['entityId'])) {
return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']); return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']);
} }
if (!PrivilegeController::hasPrivilege(['privilegeId' => 'admin_listmodels', 'userId' => $GLOBALS['id']]) && empty($listTemplate['entityId'])) { if (!PrivilegeController::hasPrivilege(['privilegeId' => 'admin_listmodels', 'userId' => $GLOBALS['id']]) && empty($listTemplate['entityId'])) {
return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']); return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']);
} }
} else { } else {
......
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