From ed4874100bfaa34ab2f5032cfdd34d52241f3eb2 Mon Sep 17 00:00:00 2001 From: Hamza Date: Thu, 12 Mar 2026 14:45:39 +0100 Subject: [PATCH] fix(proxy-write): check ACLs Signed-off-by: Hamza --- lib/CalDAV/Principal/ProxyWrite.php | 59 ++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/lib/CalDAV/Principal/ProxyWrite.php b/lib/CalDAV/Principal/ProxyWrite.php index 2d1ce7c465..2268b4f3d3 100644 --- a/lib/CalDAV/Principal/ProxyWrite.php +++ b/lib/CalDAV/Principal/ProxyWrite.php @@ -18,7 +18,7 @@ * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class ProxyWrite implements IProxyWrite +class ProxyWrite implements DAVACL\IACL ,IProxyWrite { /** * Parent principal information. @@ -158,4 +158,61 @@ public function getDisplayName() { return $this->getName(); } + + + /** + * Returns a list of ACE's for this node. + * + * Each ACE has the following properties: + * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are + * currently the only supported privileges + * * 'principal', a url to the principal who owns the node + * * 'protected' (optional), indicating that this ACE is not allowed to + * be updated. + * + * @return array + */ + public function getACL() + { + return [ + [ + 'privilege' => '{DAV:}read', + 'principal' => $this->principalInfo['uri'], + 'protected' => true, + ], + [ + 'privilege' => '{DAV:}write', + 'principal' => $this->principalInfo['uri'], + 'protected' => true, + ], + ]; + } + + /** + * @inheritDoc + */ + public function getGroup() { + return null; + } + + /** + * @inheritDoc + */ + public function getOwner() { + return $this->principalInfo['uri']; + } + + /** + * @inheritDoc + */ + public function getSupportedPrivilegeSet() { + return null; + } + + /** + * @inheritDoc + */ + public function setACL(array $acl) { + throw new DAV\Exception\Forbidden('Setting ACL is not allowed here'); + } }