mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-18 13:05:57 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user