Mantis 128: permission priority in calendar sharing

Monotone-Parent: 6918a1019209b61ce28a95f69b6866052f2da402
Monotone-Revision: c3073560ecefd7e654284be77264558f35df1171

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-09-10T20:01:24
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert
2009-09-10 20:01:24 +00:00
parent 424fc720f9
commit fbac33e308
3 changed files with 14 additions and 3 deletions
+11 -2
View File
@@ -1192,6 +1192,7 @@ static NSArray *childRecordFields = nil;
NSArray *records;
NSMutableArray *acls;
NSString *qs;
BOOL foundUserAcls;
// We look for the exact uid or any uid that begins with "@" (corresponding to groups)
qs = [NSString stringWithFormat: @"(c_object = '/%@') AND (c_uid = '%@' OR c_uid LIKE '@%%')",
@@ -1207,13 +1208,21 @@ static NSArray *childRecordFields = nil;
SOGoGroup *group;
SOGoUser *user;
foundUserAcls = NO;
for (i = 0; i < [records count]; i ++)
{
record = [records objectAtIndex: i];
currentUid = [record valueForKey: @"c_uid"];
if ([currentUid isEqualToString: uid])
[acls addObject: [record valueForKey: @"c_role"]];
else
{
[acls addObject: [record valueForKey: @"c_role"]];
foundUserAcls = YES;
}
}
if (!foundUserAcls)
{
for (i = 0; i < [records count]; i ++)
{
group = [SOGoGroup groupWithIdentifier: currentUid];
if (group)