oc: Honor calendar WebMail UI permissions on OpenChange library

By expanding roles from the given ACL to have these values as flags
inside the OpenChange library. This only applies to Calendar and
Tasks folders which stored four different access rights to three
different types of events/tasks.

As the events and tasks are stored in the same table, I have added
two new classes to manage permissions in the same way and this
avoids the code duplication called MAPIStoreCalTask(Folder|Message).
This commit is contained in:
Enrique J. Hernández Blasco
2016-02-22 17:51:54 +01:00
parent 17b2e3946c
commit 12e952eb55
19 changed files with 381 additions and 66 deletions

View File

@@ -919,6 +919,11 @@ NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
return nil;
}
- (NSArray *) expandRoles: (NSArray *) roles
{
return roles;
}
- (void) _modifyPermissionEntryForUser: (NSString *) user
withRoles: (NSArray *) roles
isAddition: (BOOL) isAddition
@@ -1053,6 +1058,7 @@ NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
NSArray *roles;
roles = [[self aclFolder] aclsForUser: [activeUser login]];
roles = [self expandRoles: roles]; // Not required here
/* Check FolderVisible right to return the table */
access = ([self exchangeRightsForRoles: roles] & RoleNone) != 0;
}
@@ -1307,6 +1313,7 @@ NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
NSArray *roles;
roles = [[self aclFolder] aclsForUser: [activeUser login]];
roles = [self expandRoles: roles];
rights = [self exchangeRightsForRoles: roles];
/* FreeBusySimple and FreeBusyDetailed does not apply here
[MS-OXCFOLD] Section 2.2.2.2.2.8 */
@@ -1664,6 +1671,7 @@ NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
NSArray *roles;
roles = [[self aclFolder] aclsForUser: [activeUser login]];
roles = [self expandRoles: roles]; // Not required
if (([self exchangeRightsForRoles: roles] & RightsFolderOwner) == 0)
return MAPISTORE_ERR_DENIED;
}