ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SharedCalendar.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\CalDAV;
4
5use Sabre\DAV\Sharing\Plugin as SPlugin;
6
14class SharedCalendar extends Calendar implements ISharedCalendar {
15
24 function getShareAccess() {
25
26 return isset($this->calendarInfo['share-access']) ? $this->calendarInfo['share-access'] : SPlugin::ACCESS_NOTSHARED;
27
28 }
29
42
43 return $this->calendarInfo['share-resource-uri'];
44
45 }
46
55 function updateInvites(array $sharees) {
56
57 $this->caldavBackend->updateInvites($this->calendarInfo['id'], $sharees);
58
59 }
60
77 function getInvites() {
78
79 return $this->caldavBackend->getInvites($this->calendarInfo['id']);
80
81 }
82
92 function setPublishStatus($value) {
93
94 $this->caldavBackend->setPublishStatus($this->calendarInfo['id'], $value);
95
96 }
97
110 function getACL() {
111
112 $acl = [];
113
114 switch ($this->getShareAccess()) {
115 case SPlugin::ACCESS_NOTSHARED :
116 case SPlugin::ACCESS_SHAREDOWNER :
117 $acl[] = [
118 'privilege' => '{DAV:}share',
119 'principal' => $this->calendarInfo['principaluri'],
120 'protected' => true,
121 ];
122 $acl[] = [
123 'privilege' => '{DAV:}share',
124 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write',
125 'protected' => true,
126 ];
127 // No break intentional!
128 case SPlugin::ACCESS_READWRITE :
129 $acl[] = [
130 'privilege' => '{DAV:}write',
131 'principal' => $this->calendarInfo['principaluri'],
132 'protected' => true,
133 ];
134 $acl[] = [
135 'privilege' => '{DAV:}write',
136 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write',
137 'protected' => true,
138 ];
139 // No break intentional!
140 case SPlugin::ACCESS_READ :
141 $acl[] = [
142 'privilege' => '{DAV:}write-properties',
143 'principal' => $this->calendarInfo['principaluri'],
144 'protected' => true,
145 ];
146 $acl[] = [
147 'privilege' => '{DAV:}write-properties',
148 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write',
149 'protected' => true,
150 ];
151 $acl[] = [
152 'privilege' => '{DAV:}read',
153 'principal' => $this->calendarInfo['principaluri'],
154 'protected' => true,
155 ];
156 $acl[] = [
157 'privilege' => '{DAV:}read',
158 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-read',
159 'protected' => true,
160 ];
161 $acl[] = [
162 'privilege' => '{DAV:}read',
163 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write',
164 'protected' => true,
165 ];
166 $acl[] = [
167 'privilege' => '{' . Plugin::NS_CALDAV . '}read-free-busy',
168 'principal' => '{DAV:}authenticated',
169 'protected' => true,
170 ];
171 break;
172 }
173 return $acl;
174
175 }
176
177
185 function getChildACL() {
186
187 $acl = [];
188
189 switch ($this->getShareAccess()) {
190 case SPlugin::ACCESS_NOTSHARED :
191 // No break intentional
192 case SPlugin::ACCESS_SHAREDOWNER :
193 // No break intentional
194 case SPlugin::ACCESS_READWRITE:
195 $acl[] = [
196 'privilege' => '{DAV:}write',
197 'principal' => $this->calendarInfo['principaluri'],
198 'protected' => true,
199 ];
200 $acl[] = [
201 'privilege' => '{DAV:}write',
202 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write',
203 'protected' => true,
204 ];
205 // No break intentional
206 case SPlugin::ACCESS_READ:
207 $acl[] = [
208 'privilege' => '{DAV:}read',
209 'principal' => $this->calendarInfo['principaluri'],
210 'protected' => true,
211 ];
212 $acl[] = [
213 'privilege' => '{DAV:}read',
214 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write',
215 'protected' => true,
216 ];
217 $acl[] = [
218 'privilege' => '{DAV:}read',
219 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-read',
220 'protected' => true,
221 ];
222 break;
223 }
224
225 return $acl;
226
227 }
228
229}
An exception for terminatinating execution or to throw for unit testing.
This object represents a CalDAV calendar.
Definition: Calendar.php:19
const NS_CALDAV
This is the official CalDAV namespace.
Definition: Plugin.php:33
This object represents a CalDAV calendar that is shared by a different user.
getShareResourceUri()
This function must return a URI that uniquely identifies the shared resource.
getShareAccess()
Returns the 'access level' for the instance of this shared resource.
updateInvites(array $sharees)
Updates the list of sharees.
getChildACL()
This method returns the ACL's for calendar objects in this calendar.
getACL()
Returns a list of ACE's for this node.
getInvites()
Returns the list of people whom this resource is shared with.
setPublishStatus($value)
Marks this calendar as published.
This plugin implements HTTP requests and properties related to:
Definition: Plugin.php:27
This interface represents a Calendar that is shared by a different user.