Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into replace_strpos_calls_in_dav_app
Signed-off-by: Faraz Samapoor <[email protected]>
  • Loading branch information
fsamapoor authored Jun 27, 2023
commit bbfe2fb821f00713f46fd896a41dfc62cc02c31a
15 changes: 13 additions & 2 deletions apps/dav/lib/Connector/Sabre/DavAclPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,19 @@ public function beforeMethod(RequestInterface $request, ResponseInterface $respo
$path = $request->getPath();

// prevent the plugin from causing an unneeded overhead for file requests
if (!str_starts_with($path, 'files/')) {
parent::beforeMethod($request, $response);
if (str_starts_with($path, 'files/')) {
return;
}

parent::beforeMethod($request, $response);

$createAddressbookOrCalendarRequest = ($request->getMethod() === 'MKCALENDAR' || $request->getMethod() === 'MKCOL')
&& (str_starts_with($path, 'addressbooks/') || str_starts_with($path, 'calendars/'));

if ($createAddressbookOrCalendarRequest) {
[$parentName] = \Sabre\Uri\split($path);
// is calendars/users/bob or addressbooks/users/bob writeable?
$this->checkPrivileges($parentName, '{DAV:}write');
}
}
}
You are viewing a condensed version of this merge commit. You can view the full changes here.