ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\SharedCalendar Class Reference

This object represents a CalDAV calendar that is shared by a different user. More...

+ Inheritance diagram for Sabre\CalDAV\SharedCalendar:
+ Collaboration diagram for Sabre\CalDAV\SharedCalendar:

Public Member Functions

 getShareAccess ()
 Returns the 'access level' for the instance of this shared resource. More...
 
 getShareResourceUri ()
 This function must return a URI that uniquely identifies the shared resource. More...
 
 updateInvites (array $sharees)
 Updates the list of sharees. More...
 
 getInvites ()
 Returns the list of people whom this resource is shared with. More...
 
 setPublishStatus ($value)
 Marks this calendar as published. More...
 
 getACL ()
 Returns a list of ACE's for this node. More...
 
 getChildACL ()
 This method returns the ACL's for calendar objects in this calendar. More...
 
- Public Member Functions inherited from Sabre\CalDAV\Calendar
 __construct (Backend\BackendInterface $caldavBackend, $calendarInfo)
 Constructor. More...
 
 getName ()
 Returns the name of the calendar. More...
 
 propPatch (PropPatch $propPatch)
 Updates properties on this node. More...
 
 getProperties ($requestedProperties)
 Returns the list of properties. More...
 
 getChild ($name)
 Returns a calendar object. More...
 
 getChildren ()
 Returns the full list of calendar objects. More...
 
 getMultipleChildren (array $paths)
 This method receives a list of paths in it's first argument. More...
 
 childExists ($name)
 Checks if a child-node exists. More...
 
 createDirectory ($name)
 Creates a new directory. More...
 
 createFile ($name, $calendarData=null)
 Creates a new file. More...
 
 delete ()
 Deletes the calendar. More...
 
 setName ($newName)
 Renames the calendar. More...
 
 getLastModified ()
 Returns the last modification date as a unix timestamp. More...
 
 getOwner ()
 Returns the owner principal. More...
 
 getACL ()
 Returns a list of ACE's for this node. More...
 
 getChildACL ()
 This method returns the ACL's for calendar objects in this calendar. More...
 
 calendarQuery (array $filters)
 Performs a calendar-query on the contents of this calendar. More...
 
 getSyncToken ()
 This method returns the current sync-token for this collection. More...
 
 getChanges ($syncToken, $syncLevel, $limit=null)
 The getChanges method returns all the changes that have happened, since the specified syncToken and the current collection. More...
 
 calendarQuery (array $filters)
 Performs a calendar-query on the contents of this calendar. More...
 
 createFile ($name, $data=null)
 Creates a new file in the directory. More...
 
 createDirectory ($name)
 Creates a new subdirectory. More...
 
 getChild ($name)
 Returns a specific child node, referenced by its name. More...
 
 getChildren ()
 Returns an array with all the child nodes. More...
 
 childExists ($name)
 Checks if a child-node with the specified name exists. More...
 
 delete ()
 Deleted the current node. More...
 
 getName ()
 Returns the name of the node. More...
 
 setName ($name)
 Renames the node. More...
 
 getLastModified ()
 Returns the last modification time, as a unix timestamp. More...
 
- Public Member Functions inherited from Sabre\DAVACL\IACL
 getOwner ()
 Returns the owner principal. More...
 
 getGroup ()
 Returns a group principal. More...
 
 getACL ()
 Returns a list of ACE's for this node. More...
 
 setACL (array $acl)
 Updates the ACL. More...
 
 getSupportedPrivilegeSet ()
 Returns the list of supported privileges for this node. More...
 
 propPatch (PropPatch $propPatch)
 Updates properties on this node. More...
 
 getProperties ($properties)
 Returns a list of properties for this nodes. More...
 
 getSyncToken ()
 This method returns the current sync-token for this collection. More...
 
 getChanges ($syncToken, $syncLevel, $limit=null)
 The getChanges method returns all the changes that have happened, since the specified syncToken and the current collection. More...
 
 getMultipleChildren (array $paths)
 This method receives a list of paths in it's first argument. More...
 
 setPublishStatus ($value)
 Marks this calendar as published. More...
 
 getShareAccess ()
 Returns the 'access level' for the instance of this shared resource. More...
 
 getShareResourceUri ()
 This function must return a URI that uniquely identifies the shared resource. More...
 
 updateInvites (array $sharees)
 Updates the list of sharees. More...
 
 getInvites ()
 Returns the list of people whom this resource is shared with. More...
 

Additional Inherited Members

- Protected Attributes inherited from Sabre\CalDAV\Calendar
 $calendarInfo
 
 $caldavBackend
 

Detailed Description

This object represents a CalDAV calendar that is shared by a different user.

Author
Evert Pot (http://evertpot.com/) @license http://sabre.io/license/ Modified BSD License

Definition at line 14 of file SharedCalendar.php.

Member Function Documentation

◆ getACL()

Sabre\CalDAV\SharedCalendar::getACL ( )

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.
Returns
array

Reimplemented from Sabre\CalDAV\Calendar.

Definition at line 110 of file SharedCalendar.php.

110 {
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 }
const NS_CALDAV
This is the official CalDAV namespace.
Definition: Plugin.php:33
getShareAccess()
Returns the 'access level' for the instance of this shared resource.

References Sabre\CalDAV\SharedCalendar\getShareAccess(), and Sabre\CalDAV\Plugin\NS_CALDAV.

+ Here is the call graph for this function:

◆ getChildACL()

Sabre\CalDAV\SharedCalendar::getChildACL ( )

This method returns the ACL's for calendar objects in this calendar.

The result of this method automatically gets passed to the calendar-object nodes in the calendar.

Returns
array

Reimplemented from Sabre\CalDAV\Calendar.

Definition at line 185 of file SharedCalendar.php.

185 {
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 }

References Sabre\CalDAV\SharedCalendar\getShareAccess().

+ Here is the call graph for this function:

◆ getInvites()

Sabre\CalDAV\SharedCalendar::getInvites ( )

Returns the list of people whom this resource is shared with.

Every item in the returned array must be a Sharee object with at least the following properties set:

  • $href
  • $shareAccess
  • $inviteStatus

and optionally:

  • $properties
Returns
\Sabre\DAV\Xml\Element\Sharee[]

Implements Sabre\DAV\Sharing\ISharedNode.

Definition at line 77 of file SharedCalendar.php.

77 {
78
79 return $this->caldavBackend->getInvites($this->calendarInfo['id']);
80
81 }

◆ getShareAccess()

Sabre\CalDAV\SharedCalendar::getShareAccess ( )

Returns the 'access level' for the instance of this shared resource.

The value should be one of the Sabre\DAV\Sharing\Plugin::ACCESS_ constants.

Returns
int

Implements Sabre\DAV\Sharing\ISharedNode.

Definition at line 24 of file SharedCalendar.php.

24 {
25
26 return isset($this->calendarInfo['share-access']) ? $this->calendarInfo['share-access'] : SPlugin::ACCESS_NOTSHARED;
27
28 }

Referenced by Sabre\CalDAV\SharedCalendar\getACL(), and Sabre\CalDAV\SharedCalendar\getChildACL().

+ Here is the caller graph for this function:

◆ getShareResourceUri()

Sabre\CalDAV\SharedCalendar::getShareResourceUri ( )

This function must return a URI that uniquely identifies the shared resource.

This URI should be identical across instances, and is also used in several other XML bodies to connect invites to resources.

This may simply be a relative reference to the original shared instance, but it could also be a urn. As long as it's a valid URI and unique.

Returns
string

Implements Sabre\DAV\Sharing\ISharedNode.

Definition at line 41 of file SharedCalendar.php.

41 {
42
43 return $this->calendarInfo['share-resource-uri'];
44
45 }

◆ setPublishStatus()

Sabre\CalDAV\SharedCalendar::setPublishStatus (   $value)

Marks this calendar as published.

Publishing a calendar should automatically create a read-only, public, subscribable calendar.

Parameters
bool$value
Returns
void

Implements Sabre\CalDAV\ISharedCalendar.

Definition at line 92 of file SharedCalendar.php.

92 {
93
94 $this->caldavBackend->setPublishStatus($this->calendarInfo['id'], $value);
95
96 }

◆ updateInvites()

Sabre\CalDAV\SharedCalendar::updateInvites ( array  $sharees)

Updates the list of sharees.

Every item must be a Sharee object.

Parameters
\Sabre\DAV\Xml\Element\Sharee[]$sharees
Returns
void

Implements Sabre\DAV\Sharing\ISharedNode.

Definition at line 55 of file SharedCalendar.php.

55 {
56
57 $this->caldavBackend->updateInvites($this->calendarInfo['id'], $sharees);
58
59 }

The documentation for this class was generated from the following file: