Commit 437be56c authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(5135) Respect ACL for management configuration saving

issue #5135
Showing with 8 additions and 1 deletion
+8 -1
......@@ -97,7 +97,9 @@ class ManagementConfigurationDialog extends simplePlugin
parent::__construct();
$this->parent = $parent;
$this->attributesAccess['saveInLdap']->setInLdap(FALSE);
/* TODO test ACL */
if (!$this->attrIsWriteable('saveInLdap')) {
$this->attributesAccess['saveInLdap']->setVisible(FALSE);
}
$this->attributesAccess['managementColumns']->setInLdap(FALSE);
$this->attributesAccess['managementColumns']->setLinearRendering(FALSE);
$columnInfos = $this->parent->getColumnConfiguration();
......@@ -119,8 +121,13 @@ class ManagementConfigurationDialog extends simplePlugin
function attrIsWriteable($attr)
{
global $config, $ui;
if (($attr === 'managementColumns') || (is_object($attr) && ($attr->getLdapName() == 'managementColumns'))) {
return TRUE;
} elseif (($attr === 'saveInLdap') || (is_object($attr) && ($attr->getLdapName() == 'saveInLdap'))) {
$acl = $ui->get_permissions(CONFIGRDN.$config->current['BASE'], 'configuration/configInLdap', 'fdManagementConfig', $this->readOnly());
return (strpos($acl, 'w') !== FALSE);
} else {
return parent::attrIsWriteable($attr);
}
......
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