mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-29 02:07:36 +00:00
Monotone-Parent: ddc6033ba0aed2dee64092066218f39bf7e6a6c9
Monotone-Revision: 2e6ec6866313aade92a1bcb4405a7ef0ff26696c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-06-04T00:40:21 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -49,6 +49,8 @@
|
||||
GCSFolder *ocsFolder;
|
||||
NSMutableDictionary *childRecords;
|
||||
NSMutableDictionary *aclCache;
|
||||
BOOL userCanAccessAllObjects; /* i.e. user obtains 'Access Object' on
|
||||
subobjects */
|
||||
}
|
||||
|
||||
+ (id) folderWithSubscriptionReference: (NSString *) reference
|
||||
@@ -88,6 +90,8 @@
|
||||
fromMailInvitation: (BOOL) isMailInvitation
|
||||
inContext: (WOContext *) localContext;
|
||||
|
||||
- (void) initializeQuickTablesAclsInContext: (WOContext *) localContext;
|
||||
|
||||
/* acls as a container */
|
||||
- (NSArray *) aclUsersForObjectAtPath: (NSArray *) objectPathArray;
|
||||
- (NSArray *) aclsForUser: (NSString *) uid
|
||||
|
||||
@@ -185,6 +185,7 @@ static NSArray *childRecordFields = nil;
|
||||
ocsFolder = nil;
|
||||
aclCache = [NSMutableDictionary new];
|
||||
childRecords = [NSMutableDictionary new];
|
||||
userCanAccessAllObjects = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -756,6 +757,26 @@ static NSArray *childRecordFields = nil;
|
||||
inContext: queryContext];
|
||||
}
|
||||
|
||||
/* handling acls from quick tables */
|
||||
- (void) initializeQuickTablesAclsInContext: (WOContext *) localContext
|
||||
{
|
||||
NSString *login;
|
||||
|
||||
if (activeUserIsOwner)
|
||||
userCanAccessAllObjects = activeUserIsOwner;
|
||||
else
|
||||
{
|
||||
login = [[localContext activeUser] login];
|
||||
/* we only grant "userCanAccessAllObjects" for role "ObjectEraser" and
|
||||
not "ObjectCreator" because the latter doesn't imply we can read
|
||||
properties from subobjects or even know their existence. */
|
||||
userCanAccessAllObjects = ([[self ownerInContext: localContext]
|
||||
isEqualToString: login]
|
||||
|| [[self aclsForUser: login]
|
||||
containsObject: SOGoRole_ObjectEraser]);
|
||||
}
|
||||
}
|
||||
|
||||
/* acls as a container */
|
||||
|
||||
- (NSArray *) aclUsersForObjectAtPath: (NSArray *) objectPathArray;
|
||||
|
||||
Reference in New Issue
Block a user