controll access on batch operations by advanced access rights

This commit is contained in:
Uwe Steinmann 2025-02-04 08:27:05 +01:00
parent ca29a27187
commit a3ea05177a

View File

@ -1473,8 +1473,8 @@ $(document).ready(function() {
/* Batch operations {{{ */ /* Batch operations {{{ */
if($settings->_batchOperations && $total) if($settings->_batchOperations && $total)
$this->contentHeading(getMLText('batch_operation')); $this->contentHeading(getMLText('batch_operation'));
if($totaldocs || $totalfolders) { if(($totaldocs || $totalfolders) && in_array('export', $settings->_batchOperations)) {
if(in_array('export', $settings->_batchOperations)) { if($accessobject->check_view_access($this, array('action'=>'export'))) {
ob_start(); ob_start();
$this->formField( $this->formField(
getMLText("include_content"), getMLText("include_content"),
@ -1496,6 +1496,7 @@ $(document).ready(function() {
/* All other batch operations are only allowed for admins */ /* All other batch operations are only allowed for admins */
if($user->isAdmin()) { if($user->isAdmin()) {
if($total && in_array('change_owner', $settings->_batchOperations)) { if($total && in_array('change_owner', $settings->_batchOperations)) {
if($accessobject->check_view_access($this, array('action'=>'change_owner'))) {
ob_start(); ob_start();
$users = $dms->getAllUsers(); $users = $dms->getAllUsers();
$options = array(); $options = array();
@ -1521,8 +1522,10 @@ $(document).ready(function() {
$content = ob_get_clean(); $content = ob_get_clean();
$this->printAccordion(getMLText('batch_change_owner'), $content); $this->printAccordion(getMLText('batch_change_owner'), $content);
} }
}
if($totaldocs && in_array('add_reviewer', $settings->_batchOperations)) { if($totaldocs && in_array('add_reviewer', $settings->_batchOperations)) {
if($accessobject->check_view_access($this, array('action'=>'add_reviewer'))) {
ob_start(); ob_start();
$users = $dms->getAllUsers(); $users = $dms->getAllUsers();
$options = array(); $options = array();
@ -1547,8 +1550,10 @@ $(document).ready(function() {
$content = ob_get_clean(); $content = ob_get_clean();
$this->printAccordion(getMLText('batch_add_reviewer'), $content); $this->printAccordion(getMLText('batch_add_reviewer'), $content);
} }
}
if($totaldocs && in_array('add_approver', $settings->_batchOperations)) { if($totaldocs && in_array('add_approver', $settings->_batchOperations)) {
if($accessobject->check_view_access($this, array('action'=>'add_approver'))) {
ob_start(); ob_start();
$users = $dms->getAllUsers(); $users = $dms->getAllUsers();
$options = array(); $options = array();
@ -1573,8 +1578,10 @@ $(document).ready(function() {
$content = ob_get_clean(); $content = ob_get_clean();
$this->printAccordion(getMLText('batch_add_approver'), $content); $this->printAccordion(getMLText('batch_add_approver'), $content);
} }
}
if($totaldocs && in_array('change_category', $settings->_batchOperations)) { if($totaldocs && in_array('change_category', $settings->_batchOperations)) {
if($accessobject->check_view_access($this, array('action'=>'change_category'))) {
ob_start(); ob_start();
$cats = $dms->getDocumentCategories(); $cats = $dms->getDocumentCategories();
if($cats) { if($cats) {
@ -1612,6 +1619,7 @@ $(document).ready(function() {
} }
} }
} }
}
// }}} // }}}
?> ?>