diff options
Diffstat (limited to 'lib/public/contacts.php')
-rw-r--r-- | lib/public/contacts.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/public/contacts.php b/lib/public/contacts.php index 36195ef9c24..d14806bd0c4 100644 --- a/lib/public/contacts.php +++ b/lib/public/contacts.php @@ -67,7 +67,7 @@ namespace OC { /** * @return mixed */ - public function isReadOnly(); + public function getPermissions(); /** * @param $id @@ -129,7 +129,7 @@ namespace OCP { return null; $address_book = self::$address_books[$address_book_key]; - if ($address_book->isReadOnly()) + if ($address_book->getPermissions() & \OCP\PERMISSION_DELETE) return null; return $address_book->delete($id); @@ -149,7 +149,7 @@ namespace OCP { return null; $address_book = self::$address_books[$address_book_key]; - if ($address_book->isReadOnly()) + if ($address_book->getPermissions() & \OCP\PERMISSION_CREATE) return null; return $address_book->createOrUpdate($properties); @@ -191,8 +191,15 @@ namespace OCP { } /** + * removes all registered address book instances + */ + public static function clear() { + self::$address_books = array(); + } + + /** * @var \OC\IAddressBook[] which holds all registered address books */ private static $address_books = array(); } -}
\ No newline at end of file +} |