mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-11 08:18:52 +00:00
Monotone-Parent: 171356cc20f8175f3b04a099c5f8098f50368f02
Monotone-Revision: a595c6678cfaad2fff0628a98bf8c21916a644d9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-12-01T22:53:11 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user