summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/UserAddressBooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/CardDAV/UserAddressBooks.php')
-rw-r--r--apps/dav/lib/CardDAV/UserAddressBooks.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/dav/lib/CardDAV/UserAddressBooks.php b/apps/dav/lib/CardDAV/UserAddressBooks.php
index f3803cf1692..8b9e22db5ac 100644
--- a/apps/dav/lib/CardDAV/UserAddressBooks.php
+++ b/apps/dav/lib/CardDAV/UserAddressBooks.php
@@ -28,9 +28,12 @@ declare(strict_types=1);
namespace OCA\DAV\CardDAV;
use OCA\DAV\AppInfo\PluginManager;
+use OCA\DAV\CardDAV\Integration\ExternalAddressBook;
use OCP\IConfig;
use OCP\IL10N;
use Sabre\CardDAV\Backend;
+use Sabre\DAV\Exception\MethodNotAllowed;
+use Sabre\DAV\MkCol;
class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
@@ -78,6 +81,14 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
}
+ public function createExtendedCollection($name, MkCol $mkCol) {
+ if (ExternalAddressBook::doesViolateReservedName($name)) {
+ throw new MethodNotAllowed('The resource you tried to create has a reserved name');
+ }
+
+ parent::createExtendedCollection($name, $mkCol);
+ }
+
/**
* Returns a list of ACE's for this node.
*