fix(calendar): Fix getting the permissions of the user

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-12-09 11:33:12 +01:00
parent 6f3ee6b09a
commit 4fd84e47bf
No known key found for this signature in database
GPG key ID: F72FA5B49FFA96B0
2 changed files with 6 additions and 2 deletions

View file

@ -110,6 +110,10 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage {
$permissions = $this->calendar->getACL();
$result = 0;
foreach ($permissions as $permission) {
if ($this->calendarInfo['principaluri'] !== $permission['principal']) {
continue;
}
switch ($permission['privilege']) {
case '{DAV:}read':
$result |= Constants::PERMISSION_READ;
@ -133,7 +137,7 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage {
public function isWritable(): bool {
return $this->calendar->canWrite();
}
/**
* @since 26.0.0
*/

View file

@ -53,7 +53,7 @@ interface ICalendar {
public function search(string $pattern, array $searchProperties = [], array $options = [], ?int $limit = null, ?int $offset = null): array;
/**
* @return int build up using \OCP\Constants
* @return int build up using {@see \OCP\Constants}
* @since 13.0.0
*/
public function getPermissions(): int;