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

FEAT #12091 TIME 0:20 Update list instances check privileges

parent 1937ab40
No related branches found
No related tags found
No related merge requests found
......@@ -113,6 +113,12 @@ class ListInstanceController
public function update(Request $request, Response $response)
{
if (!PrivilegeController::hasPrivilege(['privilegeId' => 'update_diffusion_details', 'userId' => $GLOBALS['id']])
&& !PrivilegeController::hasPrivilege(['privilegeId' => 'update_diffusion_except_recipient_details', 'userId' => $GLOBALS['id']])
&& !PrivilegeController::hasPrivilege(['privilegeId' => 'admin_users', 'userId' => $GLOBALS['id']])) {
return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']);
}
$body = $request->getParsedBody();
if (!Validator::arrayType()->notEmpty()->validate($body)) {
return $response->withStatus(400)->withJson(['errors' => 'Body is not set or not an array']);
......
This diff is collapsed.
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