mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-06 22:08:51 +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:
@@ -43,11 +43,11 @@
|
||||
#import <Mailer/SOGoTrashFolder.h>
|
||||
#import <SOGo/NSArray+Utilities.h>
|
||||
#import <SOGo/NSString+Utilities.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
|
||||
#import "MAPIApplication.h"
|
||||
#import "MAPIStoreAppointmentWrapper.h"
|
||||
#import "MAPIStoreContext.h"
|
||||
// #import "MAPIStoreDraftsMessage.h"
|
||||
#import "MAPIStoreFAIMessage.h"
|
||||
#import "MAPIStoreMailMessageTable.h"
|
||||
#import "MAPIStoreMapping.h"
|
||||
@@ -391,6 +391,11 @@ static Class SOGoMailFolderK;
|
||||
return value;
|
||||
}
|
||||
|
||||
- (SOGoFolder *) aclFolder
|
||||
{
|
||||
return (SOGoFolder *) sogoObject;
|
||||
}
|
||||
|
||||
/* synchronisation */
|
||||
|
||||
/* Tree:
|
||||
@@ -1008,6 +1013,65 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
|
||||
return newMessage;
|
||||
}
|
||||
|
||||
|
||||
- (NSArray *) rolesForExchangeRights: (uint32_t) rights
|
||||
{
|
||||
NSMutableArray *roles;
|
||||
|
||||
roles = [NSMutableArray arrayWithCapacity: 6];
|
||||
if (rights & RoleOwner)
|
||||
[roles addObject: SOGoMailRole_Administrator];
|
||||
if (rights & RightsCreateItems)
|
||||
{
|
||||
[roles addObject: SOGoRole_ObjectCreator];
|
||||
[roles addObject: SOGoMailRole_Writer];
|
||||
[roles addObject: SOGoMailRole_Poster];
|
||||
}
|
||||
if (rights & RightsDeleteAll)
|
||||
{
|
||||
[roles addObject: SOGoRole_ObjectEraser];
|
||||
[roles addObject: SOGoRole_FolderEraser];
|
||||
[roles addObject: SOGoMailRole_Expunger];
|
||||
}
|
||||
if (rights & RightsEditAll)
|
||||
[roles addObject: SOGoRole_ObjectEditor];
|
||||
if (rights & RightsReadItems)
|
||||
[roles addObject: SOGoRole_ObjectViewer];
|
||||
if (rights & RightsCreateSubfolders)
|
||||
[roles addObject: SOGoRole_FolderCreator];
|
||||
if (rights & RightsCreateSubfolders)
|
||||
[roles addObject: SOGoRole_FolderCreator];
|
||||
|
||||
return roles;
|
||||
}
|
||||
|
||||
- (uint32_t) exchangeRightsForRoles: (NSArray *) roles
|
||||
{
|
||||
uint32_t rights = 0;
|
||||
|
||||
if ([roles containsObject: SOGoMailRole_Administrator])
|
||||
rights |= (RoleOwner ^ RightsAll);
|
||||
if ([roles containsObject: SOGoRole_ObjectCreator])
|
||||
rights |= RightsCreateItems;
|
||||
if ([roles containsObject: SOGoRole_ObjectEraser]
|
||||
&& [roles containsObject: SOGoRole_FolderEraser])
|
||||
rights |= RightsDeleteAll;
|
||||
|
||||
if ([roles containsObject: SOGoRole_ObjectEditor])
|
||||
rights |= RightsEditAll;
|
||||
if ([roles containsObject: SOGoRole_ObjectViewer])
|
||||
rights |= RightsReadItems;
|
||||
if ([roles containsObject: SOGoRole_FolderCreator])
|
||||
rights |= RightsCreateSubfolders;
|
||||
if ([roles containsObject: SOGoRole_FolderCreator])
|
||||
rights |= RightsCreateSubfolders;
|
||||
|
||||
if (rights != 0)
|
||||
rights |= RoleNone; /* actually "folder visible" */
|
||||
|
||||
return rights;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MAPIStoreInboxFolder : MAPIStoreMailFolder
|
||||
|
||||
Reference in New Issue
Block a user