Use new getMyRights() instead of getACL() for better performance (Kolab_Storage-0.5.2 required)

This commit is contained in:
Aleksander Machniak (Kolab Systems) 2011-07-29 15:08:00 +02:00
parent f56e78fbf8
commit 8e78e653f3
2 changed files with 7 additions and 9 deletions

View file

@ -66,10 +66,9 @@ class kolab_calendar
$this->alarms = true;
}
else {
$acl = $this->storage->_folder->getACL();
if (is_array($acl)) {
$acl = $acl[$_SESSION['username']];
if (strpos($acl, 'i') !== false)
$rights = $this->storage->_folder->getMyRights();
if (!PEAR::isError($rights)) {
if (strpos($rights, 'i') !== false)
$this->readonly = false;
}
}

View file

@ -127,12 +127,11 @@ class rcube_kolab_contacts extends rcube_addressbook
$this->readonly = false;
}
else {
$acl = $this->storagefolder->getACL();
if (!PEAR::isError($acl) && is_array($acl)) {
$acl = $acl[$_SESSION['username']];
if (strpos($acl, 'i') !== false)
$rights = $this->storagefolder->getMyRights();
if (!PEAR::isError($rights)) {
if (strpos($rights, 'i') !== false)
$this->readonly = false;
if (strpos($acl, 'a') !== false || strpos($acl, 'x') !== false)
if (strpos($rights, 'a') !== false || strpos($rights, 'x') !== false)
$this->editable = true;
}
}