NotSupportedPrivilege.php 830 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\DAVACL\Exception;
  4. use Sabre\DAV;
  5. /**
  6. * If a client tried to set a privilege that doesn't exist, this exception will
  7. * be thrown.
  8. *
  9. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  10. * @author Evert Pot (http://evertpot.com/)
  11. * @license http://sabre.io/license/ Modified BSD License
  12. */
  13. class NotSupportedPrivilege extends DAV\Exception\PreconditionFailed
  14. {
  15. /**
  16. * Adds in extra information in the xml response.
  17. *
  18. * This method adds the {DAV:}not-supported-privilege element as defined in rfc3744
  19. */
  20. public function serialize(DAV\Server $server, \DOMElement $errorNode)
  21. {
  22. $doc = $errorNode->ownerDocument;
  23. $np = $doc->createElementNS('DAV:', 'd:not-supported-privilege');
  24. $errorNode->appendChild($np);
  25. }
  26. }