mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-19 10:25:27 +00:00
Monotone-Parent: 30720cd63a96f71fe1ddecf048357f4063f4a056
Monotone-Revision: c61e2dc9a2d1575387224156c338b5517bdcbae1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-08-21T20:39:36 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSString.h>
|
||||
@@ -46,6 +47,7 @@
|
||||
#import "MAPIStoreSamDBUtils.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "MAPIStoreUserContext.h"
|
||||
#import "NSData+MAPIStore.h"
|
||||
#import "NSDate+MAPIStore.h"
|
||||
#import "NSString+MAPIStore.h"
|
||||
#import "NSObject+MAPIStore.h"
|
||||
@@ -1315,7 +1317,51 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
||||
- (int) getPidTagAccessLevel: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x01);
|
||||
SOGoUser *ownerUser;
|
||||
BOOL userIsOwner;
|
||||
|
||||
ownerUser = [[self userContext] sogoUser];
|
||||
|
||||
userIsOwner = [[context activeUser] isEqual: ownerUser];
|
||||
|
||||
*data = MAPILongValue (memCtx, (userIsOwner) ? 0x01 : 0x00);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagRights: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t rights = 0;
|
||||
SOGoUser *ownerUser;
|
||||
BOOL userIsOwner;
|
||||
|
||||
ownerUser = [[self userContext] sogoUser];
|
||||
|
||||
userIsOwner = [[context activeUser] isEqual: ownerUser];
|
||||
if (userIsOwner || [self subscriberCanReadMessages])
|
||||
rights |= RightsReadItems;
|
||||
if (userIsOwner || [self subscriberCanCreateMessages])
|
||||
rights |= RightsCreateItems;
|
||||
if (userIsOwner || [self subscriberCanModifyMessages])
|
||||
rights |= RightsEditOwn | RightsEditAll;
|
||||
if (userIsOwner || [self subscriberCanDeleteMessages])
|
||||
rights |= RightsDeleteOwn | RightsDeleteAll;
|
||||
if ((userIsOwner || [self subscriberCanCreateSubFolders])
|
||||
&& [self supportsSubFolders])
|
||||
rights |= RightsCreateSubfolders;
|
||||
if (userIsOwner)
|
||||
rights |= RightsFolderOwner | RightsFolderContact;
|
||||
|
||||
*data = MAPILongValue (memCtx, rights);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAccessControlListData: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[NSData data] asBinaryInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user