Unverified Commit f7a1d466 authored by Jerome Boucher's avatar Jerome Boucher
Browse files

feat/13448 : discovering archives update checkRights function

parent 2e0d7ad0
Pipeline #13859 failed with stages
in 52 seconds
......@@ -1378,15 +1378,19 @@ trait archiveAccessTrait
$userServices[] = $currentUserService->registrationNumber;
// OWNER access
if (!is_null($currentUserService->orgRoleCodes)
&& \laabs\in_array('owner', $currentUserService->orgRoleCodes)) {
if (
!is_null($currentUserService->orgRoleCodes)
&& \laabs\in_array('owner', $currentUserService->orgRoleCodes)
) {
return true;
}
// ARCHIVER access
if (!is_null($currentUserService->orgRoleCodes)
if (
!is_null($currentUserService->orgRoleCodes)
&& \laabs\in_array('archiver', $currentUserService->orgRoleCodes)
&& $archive->archiverOrgRegNumber === $currentUserService->registrationNumber) {
&& $archive->archiverOrgRegNumber === $currentUserService->registrationNumber
) {
return true;
}
......@@ -1398,9 +1402,13 @@ trait archiveAccessTrait
}
// COMMUNICATION ACCESS
if (!is_null($archive->accessRuleComDate)
&& ($isCommunication)
&& ($archive->accessRuleComDate <= $currentDate)) {
if (
$isCommunication
&& (
is_null($archive->accessRuleComDate)
|| $archive->accessRuleComDate <= $currentDate
)
) {
return true;
}
......
......@@ -181,26 +181,11 @@
</div>
<!-- PARTIAL RETENTION RULE -->
<div class="col-md-4">
<div class="row">
<div class="form-group">
<div class="col-md-6">
<div class="row">
<label class="col-sm-8 control-label">Partial retention rule</label>
<div class="col-sm4 checkbox" id="partialRetentionRule">
<input type="checkbox" name="partialRetentionRule" id="partialRetentionRuleToggle">
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-8 control-label">Search in other services</label>
<div class="col-sm4 checkbox" id="isDiscoverable">
<input type="checkbox" name="isDiscoverable" id="isDiscoverableToggle">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Partial retention rule</label>
<div class="col-sm-8 checkbox" id="partialRetentionRule">
<input type="checkbox" name="partialRetentionRule" id="partialRetentionRuleToggle">
</div>
</div>
</div>
<!-- DEPOSITOR -->
......@@ -268,9 +253,4 @@
on: 'Oui',
off: 'Non'
});
$('#isDiscoverableToggle').bootstrapToggle({
on: 'Oui',
off: 'Non'
});
</script>
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