Jelajahi Sumber

fix(carddav): Mark system address book as read-only

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Christoph Wurst 1 tahun lalu
induk
melakukan
3a7074bc3e
1 mengubah file dengan 9 tambahan dan 0 penghapusan
  1. 9 0
      apps/dav/lib/CardDAV/SystemAddressbook.php

+ 9 - 0
apps/dav/lib/CardDAV/SystemAddressbook.php

@@ -50,4 +50,13 @@ class SystemAddressbook extends AddressBook {
 
 		return parent::getChildren();
 	}
+
+	public function getACL() {
+		return array_filter(parent::getACL(), function($acl) {
+			if (in_array($acl['privilege'], ['{DAV:}write', '{DAV:}all'], true)) {
+				return false;
+			}
+			return true;
+		});
+	}
 }