Monotone-Parent: 171356cc20f8175f3b04a099c5f8098f50368f02
Monotone-Revision: a595c6678cfaad2fff0628a98bf8c21916a644d9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-12-01T22:53:11 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
95d286fde9
commit
4b45d76805
|
@ -27,7 +27,9 @@
|
|||
#import <Foundation/NSURL.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <EOControl/EOQualifier.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import "EOQualifier+MAPI.h"
|
||||
#import "MAPIStoreContext.h"
|
||||
#import "MAPIStoreFSFolderTable.h"
|
||||
#import "MAPIStoreFSMessage.h"
|
||||
#import "MAPIStoreFSMessageTable.h"
|
||||
|
@ -237,4 +239,43 @@ static Class EOKeyValueQualifierK;
|
|||
return rights;
|
||||
}
|
||||
|
||||
- (BOOL) _testRoleForActiveUser: (NSString *) role
|
||||
{
|
||||
SOGoUser *activeUser;
|
||||
NSArray *roles;
|
||||
|
||||
activeUser = [[self context] activeUser];
|
||||
|
||||
roles = [[self aclFolder] aclsForUser: [activeUser login]];
|
||||
|
||||
return [roles containsObject: role];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanCreateMessages
|
||||
{
|
||||
return [self _testRoleForActiveUser: @"RightsCreateItems"];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessages
|
||||
{
|
||||
return ([self _testRoleForActiveUser: @"RightsEditAll"]
|
||||
|| [self _testRoleForActiveUser: @"RightsEditOwn"]);
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessages
|
||||
{
|
||||
return [self _testRoleForActiveUser: @"RightsReadItems"];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanDeleteMessages
|
||||
{
|
||||
return ([self _testRoleForActiveUser: @"RightsDeleteAll"]
|
||||
|| [self _testRoleForActiveUser: @"RightsDeleteOwn"]);
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanCreateSubFolders
|
||||
{
|
||||
return [self _testRoleForActiveUser: @"RightsCreateSubfolders"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#import "MAPIStorePropertySelectors.h"
|
||||
#import "SOGoMAPIFSMessage.h"
|
||||
|
||||
#import "MAPIStoreFSFolder.h"
|
||||
#import "MAPIStoreFSMessage.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "NSData+MAPIStore.h"
|
||||
|
@ -83,16 +84,29 @@
|
|||
[properties removeAllObjects];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
- (BOOL) _messageIsFreeBusy
|
||||
{
|
||||
/* This is a HACK until we figure out how to determine a message position in
|
||||
the mailbox hierarchy.... (missing: folderid and role) */
|
||||
NSString *msgClass;
|
||||
|
||||
/* This is a HACK until we figure out how to determine a message position in
|
||||
the mailbox hierarchy.... (missing: folderid and role) */
|
||||
msgClass = [[sogoObject properties]
|
||||
objectForKey: MAPIPropertyKey (PR_MESSAGE_CLASS_UNICODE)];
|
||||
|
||||
return [msgClass isEqualToString: @"IPM.Microsoft.ScheduleData.FreeBusy"];
|
||||
return [msgClass isEqualToString: @"IPM.Microsoft.ScheduleData.FreeBusy"];
|
||||
}
|
||||
|
||||
/* TODO: differentiate between the "Own" and "All" cases */
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
return ([(MAPIStoreFolder *) container subscriberCanReadMessages]
|
||||
|| [self _messageIsFreeBusy]);
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
return ([(MAPIStoreFolder *) container subscriberCanModifyMessages]
|
||||
|| [self _messageIsFreeBusy]);
|
||||
}
|
||||
|
||||
- (NSDate *) creationTime
|
||||
|
|
Loading…
Reference in New Issue