[#5436] Fix so 's' right is not removed from groupware folders

This commit is contained in:
Aleksander Machniak 2016-06-10 05:14:46 -04:00
parent 4b08dab30b
commit dbc63628ac

View file

@ -464,13 +464,11 @@ class kolab_folders extends rcube_plugin
// we're dealing with a groupware folder here... // we're dealing with a groupware folder here...
if ($type && $type !== 'mail') { if ($type && $type !== 'mail') {
if ($args['rights']['write'] && $args['rights']['delete']) { if ($args['rights']['write'] && $args['rights']['delete']) {
$writeperms = $args['rights']['write'] . $args['rights']['delete']; $write_perms = $args['rights']['write'] . $args['rights']['delete'];
$items = array( $rw_perms = $write_perms . $args['rights']['read'];
'read' => 'lr',
'write' => $writeperms, $args['rights']['write'] = $write_perms;
'other' => preg_replace('/[lr'.$writeperms.']/', '', $args['rights']['other']), $args['rights']['other'] = preg_replace("/[$rw_perms]/", '', $args['rights']['other']);
);
$args['rights'] = $items;
// add localized labels and titles for the altered items // add localized labels and titles for the altered items
$args['labels'] = array( $args['labels'] = array(
@ -501,7 +499,7 @@ class kolab_folders extends rcube_plugin
// we're dealing with a groupware folder here... // we're dealing with a groupware folder here...
if ($type && $type !== 'mail') { if ($type && $type !== 'mail') {
// remove some irrelevant (for groupware objects) rights // remove some irrelevant (for groupware objects) rights
$args['rights'] = str_split(preg_replace('/[sp]/', '', join('', $args['rights']))); $args['rights'] = str_split(preg_replace('/[p]/', '', join('', $args['rights'])));
} }
} }