Monotone-Parent: 3c3b185ac78cbde20c55f90c27b4f32909f9fdbf

Monotone-Revision: 0c6806493b569c14269ce32c78f49e2d8d0bd053

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-06-02T16:39:33
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-06-02 16:39:33 +00:00
parent 044a29c178
commit 64a0aa3d9c
2 changed files with 25 additions and 7 deletions
+6
View File
@@ -1,5 +1,11 @@
2010-06-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoGCSFolder.m (-aclsForUser:forObjectAtPath:):
extracted db code into a new "_realAclsForUser:forObjectAtPath:"
private method. When the "None" special role is returned, we
remove it from the list. Finally, we don't allow fetching default
roles when the specified uid is "anonymous".
* SoObjects/Contacts/SOGoContactFolders.m (-appendSystemSources):
we now add public sources to the list of folders if and only if
the active user is the owner of the current parent folder.
+19 -7
View File
@@ -1384,13 +1384,12 @@ static NSArray *childRecordFields = nil;
[aclsForObject removeObjectForKey: uid];
}
- (NSArray *) aclsForUser: (NSString *) uid
forObjectAtPath: (NSArray *) objectPathArray
- (NSArray *) _realAclsForUser: (NSString *) uid
forObjectAtPath: (NSArray *) objectPathArray
{
NSArray *acls;
NSString *objectPath, *module;
NSString *objectPath;
NSDictionary *aclsForObject;
SOGoDomainDefaults *dd;
objectPath = [objectPathArray componentsJoinedByString: @"/"];
aclsForObject = [aclCache objectForKey: objectPath];
@@ -1401,13 +1400,26 @@ static NSArray *childRecordFields = nil;
if (!acls)
{
acls = [self _fetchAclsForUser: uid forObjectAtPath: objectPath];
if (!acls)
if (!acls
|| ([acls count] == 1 && [acls containsObject: SOGoRole_None]))
acls = [NSArray array];
[self _cacheRoles: acls forUser: uid forObjectAtPath: objectPath];
}
if (!([acls count] || [uid isEqualToString: defaultUserID]))
acls = [self aclsForUser: defaultUserID forObjectAtPath: objectPathArray];
return acls;
}
- (NSArray *) aclsForUser: (NSString *) uid
forObjectAtPath: (NSArray *) objectPathArray
{
NSArray *acls;
NSString *module;
SOGoDomainDefaults *dd;
acls = [self _realAclsForUser: uid forObjectAtPath: objectPathArray];
if (!([acls count] || [uid isEqualToString: @"anonymous"]))
acls = [self _realAclsForUser: defaultUserID
forObjectAtPath: objectPathArray];
// If we still don't have ACLs defined for this particular resource,
// let's go get the domain defaults, if any.