From fd7d7faabd00ffed661a8dfb68abbc8408cdf278 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 12 Jun 2018 09:48:12 +0200 Subject: [PATCH] Improve checking folder delete rights according to RFC 4314 --- program/lib/Roundcube/rcube_imap.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 2d11cd521..d3fa759b0 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -3707,7 +3707,7 @@ class rcube_imap extends rcube_storage // get cached metadata $cache_key = 'mailboxes.folder-info.' . $folder; - $cached = $this->get_cache($cache_key); + $cached = $this->get_cache($cache_key); if (is_array($cached)) { return $cached; @@ -3770,7 +3770,9 @@ class rcube_imap extends rcube_storage // Set 'norename' flag if (!empty($options['rights'])) { - $options['norename'] = !in_array('x', $options['rights']) && !in_array('d', $options['rights']); + $rfc_4314 = is_array($this->get_capability('RIGHTS')); + $options['norename'] = ($rfc_4314 && !in_array('x', $options['rights'])) + || (!$rfc_4314 && !in_array('d', $options['rights'])); if (!$options['noselect']) { $options['noselect'] = !in_array('r', $options['rights']);