mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-07 08:01:23 +00:00
Monotone-Parent: 4e64b83fb714d395f79db3b2cd5c49a57e14f1f0
Monotone-Revision: 14109a6df43dc184c83153fd032827c7dc242db9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-12-01T22:36:16 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -22,8 +22,10 @@
|
||||
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import <NGObjWeb/SoSecurityManager.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <SOGo/SOGoContentObject.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
|
||||
#import "MAPIStoreContext.h"
|
||||
#import "MAPIStoreGCSFolder.h"
|
||||
@@ -48,6 +50,69 @@
|
||||
return [sogoObject lastModified];
|
||||
}
|
||||
|
||||
- (int) getPrAccess: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStoreContext *context;
|
||||
WOContext *woContext;
|
||||
SoSecurityManager *sm;
|
||||
uint32_t access;
|
||||
|
||||
context = [self context];
|
||||
if ([[context activeUser] isEqual: [context ownerUser]])
|
||||
access = 0x03;
|
||||
else
|
||||
{
|
||||
sm = [SoSecurityManager sharedSecurityManager];
|
||||
woContext = [context woContext];
|
||||
|
||||
access = 0;
|
||||
if (![sm validatePermission: SoPerm_ChangeImagesAndFiles
|
||||
onObject: sogoObject
|
||||
inContext: woContext])
|
||||
access |= 1;
|
||||
if (![sm validatePermission: SoPerm_AccessContentsInformation
|
||||
onObject: sogoObject
|
||||
inContext: woContext])
|
||||
access |= 2;
|
||||
if (![sm validatePermission: SOGoPerm_DeleteObject
|
||||
onObject: sogoObject
|
||||
inContext: woContext])
|
||||
access |= 4;
|
||||
}
|
||||
*data = MAPILongValue (memCtx, access);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPrAccessLevel: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStoreContext *context;
|
||||
WOContext *woContext;
|
||||
SoSecurityManager *sm;
|
||||
uint32_t accessLvl;
|
||||
|
||||
context = [self context];
|
||||
if ([[context activeUser] isEqual: [context ownerUser]])
|
||||
accessLvl = 1;
|
||||
else
|
||||
{
|
||||
sm = [SoSecurityManager sharedSecurityManager];
|
||||
woContext = [context woContext];
|
||||
|
||||
if (![sm validatePermission: SoPerm_ChangeImagesAndFiles
|
||||
onObject: sogoObject
|
||||
inContext: woContext])
|
||||
accessLvl = 1;
|
||||
else
|
||||
accessLvl = 0;
|
||||
}
|
||||
*data = MAPILongValue (memCtx, accessLvl);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPrChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user