Commit 4df8ea9d authored by Arnaud Pauget's avatar Arnaud Pauget
Browse files

fix(18080) : fix deleted actions by an other commit

parent 039a01aa
Pipeline #14660 failed with stages
in 59 seconds
......@@ -1349,6 +1349,7 @@ class archive
protected function readPrivilegesOnArchives()
{
$hasModificationPrivilege = \laabs::callService('auth/userAccount/readHasprivilege', "archiveManagement/modify");
$hasModificationOriginatorPrivilege = \laabs::callService('auth/userAccount/readHasprivilege', "archiveManagement/adminOriginator");
$hasIntegrityCheckPrivilege = \laabs::callService('auth/userAccount/readHasprivilege', "archiveManagement/checkIntegrity");
$hasDestructionPrivilege = \laabs::callService('auth/userAccount/readHasprivilege', "destruction/destructionRequest");
$hasRestitutionPrivilege = $this->transaction && \laabs::callService('auth/userAccount/readHasprivilege', "restitution/restitutionRequest");
......@@ -1357,6 +1358,7 @@ class archive
$hasModificationRequestPrivilege = $this->transaction && \laabs::callService('auth/userAccount/readHasprivilege', "archiveManagement/modificationRequestSend");
$this->view->setSource('hasModificationPrivilege', $hasModificationPrivilege);
$this->view->setSource('hasModificationOriginatorPrivilege', $hasModificationOriginatorPrivilege);
$this->view->setSource('hasIntegrityCheckPrivilege', $hasIntegrityCheckPrivilege);
$this->view->setSource('hasDestructionPrivilege', $hasDestructionPrivilege);
$this->view->setSource('hasRestitutionPrivilege', $hasRestitutionPrivilege);
......@@ -1428,4 +1430,31 @@ class archive
return $file;
}
/**
* Serializer JSON for changing originator method
* @param array $result
*
* @return object JSON object with a status and message parameters
*/
public function setOriginator($result)
{
$success = count($result['success']);
$echec = count($result['error']);
$this->json->message = '%1$s archive(s) modified.';
$this->json->message = $this->translator->getText($this->json->message);
$this->json->message = sprintf($this->json->message, $success);
if ($echec > 0) {
$message = '%1$s archive(s) can not be modified.';
$message = $this->translator->getText($message);
$message = sprintf($message, $echec);
$this->json->message .= ' '.$message;
}
return $this->json->save();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment