mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-24 15:42:43 +00:00
Monotone-Parent: d102adf292e54c9c4f3572b83e38879d24b721d0
Monotone-Revision: 1d22ee7adc99b9420d9a7b859dfb1048c8c92eaa Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-18T15:26:03 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -193,4 +193,64 @@ static Class EOKeyValueQualifierK;
|
||||
return date;
|
||||
}
|
||||
|
||||
- (SOGoFolder *) aclFolder
|
||||
{
|
||||
return propsFolder;
|
||||
}
|
||||
|
||||
- (NSArray *) rolesForExchangeRights: (uint32_t) rights
|
||||
{
|
||||
NSMutableArray *roles;
|
||||
|
||||
roles = [NSMutableArray arrayWithCapacity: 9];
|
||||
if (rights & RightsReadItems)
|
||||
[roles addObject: @"RightsReadItems"];
|
||||
if (rights & RightsCreateItems)
|
||||
[roles addObject: @"RightsCreateItems"];
|
||||
if (rights & RightsEditOwn)
|
||||
[roles addObject: @"RightsEditOwn"];
|
||||
if (rights & RightsDeleteOwn)
|
||||
[roles addObject: @"RightsDeleteOwn"];
|
||||
if (rights & RightsEditAll)
|
||||
[roles addObject: @"RightsEditAll"];
|
||||
if (rights & RightsDeleteAll)
|
||||
[roles addObject: @"RightsDeleteAll"];
|
||||
if (rights & RightsCreateSubfolders)
|
||||
[roles addObject: @"RightsCreateSubfolders"];
|
||||
if (rights & RightsFolderOwner)
|
||||
[roles addObject: @"RightsFolderOwner"];
|
||||
if (rights & RightsFolderContact)
|
||||
[roles addObject: @"RightsFolderContact"];
|
||||
|
||||
return roles;
|
||||
}
|
||||
|
||||
- (uint32_t) exchangeRightsForRoles: (NSArray *) roles
|
||||
{
|
||||
uint32_t rights = 0;
|
||||
|
||||
if ([roles containsObject: @"RightsReadItems"])
|
||||
rights |= RightsReadItems;
|
||||
if ([roles containsObject: @"RightsCreateItems"])
|
||||
rights |= RightsCreateItems;
|
||||
if ([roles containsObject: @"RightsEditOwn"])
|
||||
rights |= RightsEditOwn;
|
||||
if ([roles containsObject: @"RightsDeleteOwn"])
|
||||
rights |= RightsDeleteOwn;
|
||||
if ([roles containsObject: @"RightsEditAll"])
|
||||
rights |= RightsEditAll;
|
||||
if ([roles containsObject: @"RightsDeleteAll"])
|
||||
rights |= RightsDeleteAll;
|
||||
if ([roles containsObject: @"RightsCreateSubfolders"])
|
||||
rights |= RightsCreateSubfolders;
|
||||
if ([roles containsObject: @"RightsFolderOwner"])
|
||||
rights |= RightsFolderOwner;
|
||||
if ([roles containsObject: @"RightsFolderContact"])
|
||||
rights |= RightsFolderContact;
|
||||
if (rights != 0)
|
||||
rights |= RoleNone; /* actually "folder visible" */
|
||||
|
||||
return rights;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user