Merge pull request #231 from zentyal/ejhernandez/calendar-perm
Calendar folder permission roles
This commit is contained in:
commit
65670027cb
|
@ -77,6 +77,17 @@
|
||||||
|
|
||||||
- (NSArray *) rolesForExchangeRights: (uint32_t) rights
|
- (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;
|
NSMutableArray *roles;
|
||||||
|
|
||||||
roles = [NSMutableArray arrayWithCapacity: 6];
|
roles = [NSMutableArray arrayWithCapacity: 6];
|
||||||
|
@ -121,7 +132,7 @@
|
||||||
if ([roles containsObject: SOGoCalendarRole_PublicModifier]
|
if ([roles containsObject: SOGoCalendarRole_PublicModifier]
|
||||||
&& [roles containsObject: SOGoCalendarRole_PrivateModifier]
|
&& [roles containsObject: SOGoCalendarRole_PrivateModifier]
|
||||||
&& [roles containsObject: SOGoCalendarRole_ConfidentialModifier])
|
&& [roles containsObject: SOGoCalendarRole_ConfidentialModifier])
|
||||||
rights |= RightsReadItems | RightsEditAll | RightsEditOwn;
|
rights |= RightsReadItems | RightsEditAll | RightsEditOwn | RightsFreeBusySimple | RightsFreeBusyDetailed;
|
||||||
else if ([roles containsObject: SOGoCalendarRole_PublicViewer]
|
else if ([roles containsObject: SOGoCalendarRole_PublicViewer]
|
||||||
&& [roles containsObject: SOGoCalendarRole_PrivateViewer]
|
&& [roles containsObject: SOGoCalendarRole_PrivateViewer]
|
||||||
&& [roles containsObject: SOGoCalendarRole_ConfidentialViewer])
|
&& [roles containsObject: SOGoCalendarRole_ConfidentialViewer])
|
||||||
|
@ -135,7 +146,7 @@
|
||||||
if ([roles containsObject: SOGoCalendarRole_ConfidentialDAndTViewer])
|
if ([roles containsObject: SOGoCalendarRole_ConfidentialDAndTViewer])
|
||||||
rights |= RightsFreeBusyDetailed;
|
rights |= RightsFreeBusyDetailed;
|
||||||
|
|
||||||
if (rights != 0)
|
if ((rights & RightsReadItems) != 0 || (rights & RightsCreateItems) != 0 || (rights & RightsDeleteAll) != 0)
|
||||||
rights |= RoleNone; /* actually "folder visible" */
|
rights |= RoleNone; /* actually "folder visible" */
|
||||||
|
|
||||||
// [self logWithFormat: @"rights for roles (%@) = %.8x", roles, rights];
|
// [self logWithFormat: @"rights for roles (%@) = %.8x", roles, rights];
|
||||||
|
|
Loading…
Reference in a new issue