@@ -48,6 +48,12 @@ function getDefaultCalendarObject(props = {}) {
4848 canBeShared : false ,
4949 // Whether or not the calendar can be published by me
5050 canBePublished : false ,
51+ // Whether or not I can create objects in this calendar
52+ canCreateObject : false ,
53+ // Whether or not I can modify objects in this calendar
54+ canModifyObject : false ,
55+ // Whether or not I can delete objects in this calendar
56+ canDeleteObject : false ,
5157 // Reference to cdav-lib object
5258 dav : false ,
5359 // All calendar-objects from this calendar that have already been fetched
@@ -86,6 +92,9 @@ function mapDavCollectionToCalendar(calendar, currentUserPrincipal) {
8692 const readOnly = ! calendar . isWriteable ( )
8793 const canBeShared = calendar . isShareable ( )
8894 const canBePublished = calendar . isPublishable ( )
95+ const canCreateObject = calendar . currentUserPrivilegeSet . includes ( '{DAV:}bind' ) || calendar . currentUserPrivilegeSet . includes ( '{DAV:}write' ) || calendar . currentUserPrivilegeSet . includes ( '{DAV:}all' ) === true
96+ const canModifyObject = calendar . currentUserPrivilegeSet . includes ( '{DAV:}write-content' ) || calendar . currentUserPrivilegeSet . includes ( '{DAV:}write' ) || calendar . currentUserPrivilegeSet . includes ( '{DAV:}all' ) === true
97+ const canDeleteObject = calendar . currentUserPrivilegeSet . includes ( '{DAV:}unbind' ) || calendar . currentUserPrivilegeSet . includes ( '{DAV:}write' ) || calendar . currentUserPrivilegeSet . includes ( '{DAV:}all' ) === true
8998 const order = calendar . order || 0
9099 const url = calendar . url
91100 const publishURL = calendar . publishURL || null
@@ -146,6 +155,9 @@ function mapDavCollectionToCalendar(calendar, currentUserPrincipal) {
146155 publishURL,
147156 canBeShared,
148157 canBePublished,
158+ canCreateObject,
159+ canModifyObject,
160+ canDeleteObject,
149161 shares,
150162 timezone,
151163 transparency,
0 commit comments