mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-10 09:21:23 +00:00
oc-calendar: Add edit/delete own and Folder Contact/Owner sharing perm
By storing these custom MAPI roles in the ACL. The extension field 'X-SOGO-COMPONENT-CREATED-BY' is used to store the event creator when it is done from Outlook. It is the same field SOGo uses when an event is created from a shared folder in the webmail. The creator and the organizer/owner of the event can be different and it can be used from external sources by checking the organizer field. This matches the specification from [MS-OXOCAL] Section 1.1 which defines the organizer as the owner or creator of the event.
This commit is contained in:
@@ -528,6 +528,16 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
||||
ASSIGN (sogoObject, newObject);
|
||||
}
|
||||
|
||||
- (NSString *) creator
|
||||
{
|
||||
return [[self _appointmentWrapper] creator];
|
||||
}
|
||||
|
||||
- (NSString *) owner
|
||||
{
|
||||
return [[self _appointmentWrapper] owner];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
NSArray *roles;
|
||||
@@ -539,20 +549,6 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
||||
|| [self subscriberCanModifyMessage]);
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
BOOL rc;
|
||||
NSArray *roles = [self activeUserRoles];
|
||||
|
||||
if (isNew)
|
||||
rc = [roles containsObject: SOGoRole_ObjectCreator];
|
||||
else
|
||||
rc = ([roles containsObject: SOGoCalendarRole_ComponentModifier]
|
||||
|| [roles containsObject: SOGoCalendarRole_ComponentResponder]);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (void) _updateAttachedEvents
|
||||
{
|
||||
NSArray *allAttachments;
|
||||
@@ -632,6 +628,7 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
||||
[masterEvent updateFromMAPIProperties: properties
|
||||
inUserContext: [self userContext]
|
||||
withActiveUser: activeUser
|
||||
isNew: isNew
|
||||
inMemCtx: memCtx];
|
||||
[self _updateAttachedEvents];
|
||||
[[self userContext] activate];
|
||||
|
||||
Reference in New Issue
Block a user