See ChangeLog

Monotone-Parent: b3a24e425f02d22903e826a50c1e2421ea43be6f
Monotone-Revision: 968254dd9df1cf87e5269ec6f7f31e31acc794bc

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-05-06T21:57:21
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2009-05-06 21:57:21 +00:00
parent e812288063
commit ab786b6889
6 changed files with 108 additions and 134 deletions
+19 -4
View File
@@ -397,7 +397,6 @@ static NSArray *childRecordFields = nil;
- (BOOL) create
{
NSException *result;
result = [[self folderManager] createFolderOfType: [self folderType]
withName: displayName
atPath: ocsPath];
@@ -886,16 +885,32 @@ static NSArray *childRecordFields = nil;
forObjectAtPath: (NSArray *) objectPathArray
{
EOQualifier *qualifier;
NSString *uids, *qs, *objectPath;
NSString *uid, *uids, *qs, *objectPath;
NSMutableArray *usersAndGroups;
NSMutableDictionary *aclsForObject;
SOGoGroup *group;
unsigned int i;
if ([users count] > 0)
{
usersAndGroups = [NSMutableArray arrayWithArray: users];
for (i = 0; i < [usersAndGroups count]; i++)
{
uid = [usersAndGroups objectAtIndex: i];
if (![uid hasPrefix: @"@"])
{
// Prefix the UID with the character "@" when dealing with a group
group = [SOGoGroup groupWithIdentifier: uid];
if (group)
[usersAndGroups replaceObjectAtIndex: i
withObject: [NSString stringWithFormat: @"@%@", uid]];
}
}
objectPath = [objectPathArray componentsJoinedByString: @"/"];
aclsForObject = [aclCache objectForKey: objectPath];
if (aclsForObject)
[aclsForObject removeObjectsForKeys: users];
uids = [users componentsJoinedByString: @"') OR (c_uid = '"];
[aclsForObject removeObjectsForKeys: usersAndGroups];
uids = [usersAndGroups componentsJoinedByString: @"') OR (c_uid = '"];
qs = [NSString
stringWithFormat: @"(c_object = '/%@') AND ((c_uid = '%@'))",
objectPath, uids];