Monotone-Parent: 4e64b83fb714d395f79db3b2cd5c49a57e14f1f0

Monotone-Revision: 14109a6df43dc184c83153fd032827c7dc242db9

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-12-01T22:36:16
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-12-01 22:36:16 +00:00
parent 97c30caf0d
commit e846ec1b8c
2 changed files with 69 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2011-12-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreGCSMessage.m (-getPrAccess:inMemCtx:)
(-getPrAccessLevel:inMemCtx:): return a value based on the ACL
getters below.
* OpenChange/MAPIStoreFSMessage.m (-subscriberCanReadMessage):
returns YES when the message is of class
"IPM.Microsoft.ScheduleData.FreeBusy", as a hack until freebusy

View File

@ -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
{