Prevent creation of reserved address book name
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
ec245d5fec
commit
827c0980d8
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue