Fix bug where read-only folder was displayed as read-write in delegation form and it wasn't possible to unset ACL on a folder (#5347)
This commit is contained in:
parent
8ac3269ee5
commit
b6c1f28c04
2 changed files with 9 additions and 11 deletions
|
@ -188,8 +188,8 @@ rcube_webmail.prototype.delegate_save = function()
|
||||||
}
|
}
|
||||||
|
|
||||||
data.folders = {};
|
data.folders = {};
|
||||||
$('input.read:checked').each(function(i, elem) {
|
$('input.read').each(function(i, elem) {
|
||||||
data.folders[elem.value] = 1;
|
data.folders[elem.value] = this.checked ? 1 : 0;
|
||||||
});
|
});
|
||||||
$('input.write:checked').each(function(i, elem) {
|
$('input.write:checked').each(function(i, elem) {
|
||||||
data.folders[elem.value] = 2;
|
data.folders[elem.value] = 2;
|
||||||
|
|
|
@ -105,6 +105,9 @@ class kolab_delegation_engine
|
||||||
if ($r) {
|
if ($r) {
|
||||||
$storage->set_acl($folder_name, $uid, $r);
|
$storage->set_acl($folder_name, $uid, $r);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$storage->delete_acl($folder_name, $uid);
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($folders) && isset($folders[$folder_name])) {
|
if (!empty($folders) && isset($folders[$folder_name])) {
|
||||||
unset($folders[$folder_name]);
|
unset($folders[$folder_name]);
|
||||||
|
@ -863,12 +866,10 @@ class kolab_delegation_engine
|
||||||
/**
|
/**
|
||||||
* Compares two ACLs (according to supported rights)
|
* Compares two ACLs (according to supported rights)
|
||||||
*
|
*
|
||||||
* @todo: this is stolen from acl plugin, move to rcube_storage/rcube_imap
|
|
||||||
*
|
|
||||||
* @param array $acl1 ACL rights array (or string)
|
* @param array $acl1 ACL rights array (or string)
|
||||||
* @param array $acl2 ACL rights array (or string)
|
* @param array $acl2 ACL rights array (or string)
|
||||||
*
|
*
|
||||||
* @param int Comparision result, 2 - full match, 1 - partial match, 0 - no match
|
* @param bool True if $acl1 contains all rights from $acl2
|
||||||
*/
|
*/
|
||||||
function acl_compare($acl1, $acl2)
|
function acl_compare($acl1, $acl2)
|
||||||
{
|
{
|
||||||
|
@ -884,12 +885,9 @@ class kolab_delegation_engine
|
||||||
$cnt1 = count($res);
|
$cnt1 = count($res);
|
||||||
$cnt2 = count($acl2);
|
$cnt2 = count($acl2);
|
||||||
|
|
||||||
if ($cnt1 == $cnt2)
|
if ($cnt1 >= $cnt2) {
|
||||||
return 2;
|
return true;
|
||||||
else if ($cnt1)
|
}
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue