From dbfd86db0497d16e2eb5b7a54cf0c7fd43657630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Wed, 23 Dec 2015 00:27:09 +0100 Subject: [PATCH] oc: Set Editor as role is now possible in Outlook According to [MS-OXCPERM] Section 2.2.7 in PidTagMemberRights possible values, once we set the DeleteAny flag, the DeleteOwned flag must be set. Likewise EditOwned must be set when EditAny is set. In this way, the rights sent by the MAPI client are equal to the returned by the server when Editor is set. In real world practice, makes more strict Outlook 2013 work with editor permissions the sharing of user's defined calendars, tasks or contacts folders as the recipients can be editors of that folder. --- OpenChange/MAPIStoreCalendarFolder.m | 4 ++-- OpenChange/MAPIStoreContactsFolder.m | 4 ++-- OpenChange/MAPIStoreDBFolder.m | 4 ++-- OpenChange/MAPIStoreMailFolder.m | 4 ++-- OpenChange/MAPIStoreTasksFolder.m | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/OpenChange/MAPIStoreCalendarFolder.m b/OpenChange/MAPIStoreCalendarFolder.m index 2e131387b..5c9d70b39 100644 --- a/OpenChange/MAPIStoreCalendarFolder.m +++ b/OpenChange/MAPIStoreCalendarFolder.m @@ -117,11 +117,11 @@ if ([roles containsObject: SOGoRole_ObjectCreator]) rights |= RightsCreateItems; if ([roles containsObject: SOGoRole_ObjectEraser]) - rights |= RightsDeleteAll; + rights |= RightsDeleteAll | RightsDeleteOwn; if ([roles containsObject: SOGoCalendarRole_PublicModifier] && [roles containsObject: SOGoCalendarRole_PrivateModifier] && [roles containsObject: SOGoCalendarRole_ConfidentialModifier]) - rights |= RightsReadItems | RightsEditAll; + rights |= RightsReadItems | RightsEditAll | RightsEditOwn; else if ([roles containsObject: SOGoCalendarRole_PublicViewer] && [roles containsObject: SOGoCalendarRole_PrivateViewer] && [roles containsObject: SOGoCalendarRole_ConfidentialViewer]) diff --git a/OpenChange/MAPIStoreContactsFolder.m b/OpenChange/MAPIStoreContactsFolder.m index 823f467cd..a04110d0f 100644 --- a/OpenChange/MAPIStoreContactsFolder.m +++ b/OpenChange/MAPIStoreContactsFolder.m @@ -96,9 +96,9 @@ if ([roles containsObject: SOGoRole_ObjectCreator]) rights |= RightsCreateItems; if ([roles containsObject: SOGoRole_ObjectEraser]) - rights |= RightsDeleteAll; + rights |= RightsDeleteAll | RightsDeleteOwn; if ([roles containsObject: SOGoRole_ObjectEditor]) - rights |= RightsEditAll; + rights |= RightsEditAll | RightsEditOwn; if ([roles containsObject: SOGoRole_ObjectViewer]) rights |= RightsReadItems; if (rights != 0) diff --git a/OpenChange/MAPIStoreDBFolder.m b/OpenChange/MAPIStoreDBFolder.m index 9e7a6d713..a7c49b72d 100644 --- a/OpenChange/MAPIStoreDBFolder.m +++ b/OpenChange/MAPIStoreDBFolder.m @@ -321,9 +321,9 @@ static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact"; if ([roles containsObject: MAPIStoreRightDeleteOwn]) rights |= RightsDeleteOwn; if ([roles containsObject: MAPIStoreRightEditAll]) - rights |= RightsEditAll; + rights |= RightsEditAll | RightsEditOwn; if ([roles containsObject: MAPIStoreRightDeleteAll]) - rights |= RightsDeleteAll; + rights |= RightsDeleteAll | RightsDeleteOwn; if ([roles containsObject: MAPIStoreRightCreateSubfolders]) rights |= RightsCreateSubfolders; if ([roles containsObject: MAPIStoreRightFolderOwner]) diff --git a/OpenChange/MAPIStoreMailFolder.m b/OpenChange/MAPIStoreMailFolder.m index 02e25acbd..6e87d4ecd 100644 --- a/OpenChange/MAPIStoreMailFolder.m +++ b/OpenChange/MAPIStoreMailFolder.m @@ -1711,10 +1711,10 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP) rights |= RightsCreateItems; if ([roles containsObject: SOGoRole_ObjectEraser] && [roles containsObject: SOGoRole_FolderEraser]) - rights |= RightsDeleteAll; + rights |= RightsDeleteAll | RightsDeleteOwn; if ([roles containsObject: SOGoRole_ObjectEditor]) - rights |= RightsEditAll; + rights |= RightsEditAll | RightsEditOwn; if ([roles containsObject: SOGoRole_ObjectViewer]) rights |= RightsReadItems; if ([roles containsObject: SOGoRole_FolderCreator]) diff --git a/OpenChange/MAPIStoreTasksFolder.m b/OpenChange/MAPIStoreTasksFolder.m index d777b8e8b..9bc76def1 100644 --- a/OpenChange/MAPIStoreTasksFolder.m +++ b/OpenChange/MAPIStoreTasksFolder.m @@ -107,11 +107,11 @@ if ([roles containsObject: SOGoRole_ObjectCreator]) rights |= RightsCreateItems; if ([roles containsObject: SOGoRole_ObjectEraser]) - rights |= RightsDeleteAll; + rights |= RightsDeleteAll | RightsDeleteOwn; if ([roles containsObject: SOGoCalendarRole_PublicModifier] && [roles containsObject: SOGoCalendarRole_PrivateModifier] && [roles containsObject: SOGoCalendarRole_ConfidentialModifier]) - rights |= RightsReadItems | RightsEditAll; + rights |= RightsReadItems | RightsEditAll | RightsEditOwn; else if ([roles containsObject: SOGoCalendarRole_PublicViewer] && [roles containsObject: SOGoCalendarRole_PrivateViewer] && [roles containsObject: SOGoCalendarRole_ConfidentialViewer])