From 4278e417a787205f1dc6fe4ce23fda959a48b5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Thu, 7 Jan 2016 01:13:32 +0100 Subject: [PATCH 1/3] oc-calendar: Enable editor role When Outlook sets the editor role, the FreeBusyDetailed and FreeBusySimple right flags are set as Full Details are available. When we store this information in SOGo, the SOGoCalendarRole_PublicModifier, SOGoCalendarRole_PrivateModifier and SOGoCalendarRole_ConfidentialModifier are stored as well as the free busy related roles, but as [SOGoAppointmentFolder aclsForUser:forObjectAtPath] only returns the highest access rights, we have to set as well the FreeBusy flags. More details on [MS-OXCPERM] Section 2.2.6 --- OpenChange/MAPIStoreCalendarFolder.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenChange/MAPIStoreCalendarFolder.m b/OpenChange/MAPIStoreCalendarFolder.m index 5c9d70b39..fc4ec5b76 100644 --- a/OpenChange/MAPIStoreCalendarFolder.m +++ b/OpenChange/MAPIStoreCalendarFolder.m @@ -121,7 +121,7 @@ if ([roles containsObject: SOGoCalendarRole_PublicModifier] && [roles containsObject: SOGoCalendarRole_PrivateModifier] && [roles containsObject: SOGoCalendarRole_ConfidentialModifier]) - rights |= RightsReadItems | RightsEditAll | RightsEditOwn; + rights |= RightsReadItems | RightsEditAll | RightsEditOwn | RightsFreeBusySimple | RightsFreeBusyDetailed; else if ([roles containsObject: SOGoCalendarRole_PublicViewer] && [roles containsObject: SOGoCalendarRole_PrivateViewer] && [roles containsObject: SOGoCalendarRole_ConfidentialViewer]) From e0b7efbbbfd266428a0f9ab42ae3686b9b96fb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Thu, 7 Jan 2016 01:21:25 +0100 Subject: [PATCH 2/3] oc-calendar: Set simple and Detailed Free/Busy permission level By restricting when FolderVisible right is set to the following rights: * ReadAny * EditAny * DeleteAny This goes beyond what specs says about when FolderVisible right is mandatory but there is no more information stored in SOGo (no possibility to set FolderVisible specific right) See [MS-OXCPERM] Section 2.2.6 for more details --- OpenChange/MAPIStoreCalendarFolder.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenChange/MAPIStoreCalendarFolder.m b/OpenChange/MAPIStoreCalendarFolder.m index fc4ec5b76..f7b84d51e 100644 --- a/OpenChange/MAPIStoreCalendarFolder.m +++ b/OpenChange/MAPIStoreCalendarFolder.m @@ -135,7 +135,7 @@ if ([roles containsObject: SOGoCalendarRole_ConfidentialDAndTViewer]) rights |= RightsFreeBusyDetailed; - if (rights != 0) + if ((rights & RightsReadItems) != 0 || (rights & RightsCreateItems) != 0 || (rights & RightsDeleteAll) != 0) rights |= RoleNone; /* actually "folder visible" */ // [self logWithFormat: @"rights for roles (%@) = %.8x", roles, rights]; From 57fad470fbcf6123c85baacfc2f0f88a36492a60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Thu, 7 Jan 2016 01:47:29 +0100 Subject: [PATCH 3/3] oc-calendar: Detail limitations on setting permissions As MAPI permission flags are much more detailed that SOGo ones. --- OpenChange/MAPIStoreCalendarFolder.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/OpenChange/MAPIStoreCalendarFolder.m b/OpenChange/MAPIStoreCalendarFolder.m index f7b84d51e..5079c65cc 100644 --- a/OpenChange/MAPIStoreCalendarFolder.m +++ b/OpenChange/MAPIStoreCalendarFolder.m @@ -77,6 +77,17 @@ - (NSArray *) rolesForExchangeRights: (uint32_t) rights { + /* Limitations + + Following rights are not supported by SOGo specifically: + + - DeleteOwned : Delete only own objects + - EditOwned : Edit only own objects + - CreateSubfolders: No calendar subfolders + - FolderOwner: No sharing folder ownership? + - FolderContact: No support to store this information + - FolderVisible: It is inferred by other rights when extracting + */ NSMutableArray *roles; roles = [NSMutableArray arrayWithCapacity: 6];