summaryrefslogtreecommitdiffstats
path: root/lib/kolab_client_task.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-12-16 13:40:30 +0100
committerAleksander Machniak <alec@alec.pl>2013-12-16 13:40:30 +0100
commit28f909b3ea3487eb7dee4f4c1dd244d8e4da7255 (patch)
tree23245c490816c9b5c3610c8684574dd710d28a51 /lib/kolab_client_task.php
parentad120e43b18afe45914f667e24e0a375dd99920c (diff)
downloadwebadmin-28f909b3ea3487eb7dee4f4c1dd244d8e4da7255.tar.gz
Skip regenerate request for auto-fields that are readonly (by ACL)
Diffstat (limited to 'lib/kolab_client_task.php')
-rw-r--r--lib/kolab_client_task.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index c845126..20c4bc0 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -1063,6 +1063,7 @@ class kolab_client_task
$admin_auto_fields_rw = $this->config_get('admin_auto_fields_rw', false, Conf::BOOL);
foreach ($fields as $idx => $field) {
+ $readonly = null;
if (!array_key_exists($idx, $attribute_rights)) {
// If the entry level rights contain 'add' and 'delete', well, you're an admin
if (in_array('add', $entry_rights) && in_array('delete', $entry_rights)) {
@@ -1071,7 +1072,7 @@ class kolab_client_task
}
}
else {
- $fields[$idx]['readonly'] = true;
+ $fields[$idx]['readonly'] = $readonly = true;
}
}
else {
@@ -1081,10 +1082,18 @@ class kolab_client_task
}
}
// Explicit attribute level rights, check for 'write'
- elseif (!in_array('write', $attribute_rights[$idx])) {
- $fields[$idx]['readonly'] = true;
+ else if (!in_array('write', $attribute_rights[$idx])) {
+ $fields[$idx]['readonly'] = $readonly = true;
}
}
+
+ // disable auto-fields updates, user has no rights to modify them anyway
+ if (is_bool($readonly) && $readonly) {
+ if (($s_idx = array_search($idx, $auto_attribs)) !== false) {
+ unset($auto_attribs[$s_idx]);
+ }
+ unset($auto_fields[$idx]);
+ }
}
// Register list of auto-generated fields