mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-29 09:00:31 +00:00
Monotone-Parent: ba0063d228f496f6d43be55b3d6aeb33e2ba34e1
Monotone-Revision: 9f7fe2aea256613b84bdc296bef103767495048d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-04-24T22:45:38 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
+19
-11
@@ -284,33 +284,41 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setRoles: (NSString *) roles
|
||||
- (void) setRoles: (NSArray *) roles
|
||||
forUser: (NSString *) uid
|
||||
forObjectAtPath: (NSArray *) objectPathArray
|
||||
{
|
||||
EOAdaptorChannel *channel;
|
||||
GCSFolder *folder;
|
||||
NSString *SQL;
|
||||
NSEnumerator *userRoles;
|
||||
NSString *SQL, *currentRole;
|
||||
|
||||
[self removeAclsForUsers: [NSArray arrayWithObject: uid]
|
||||
forObjectAtPath: objectPathArray];
|
||||
folder = [self ocsFolder];
|
||||
channel = [folder acquireAclChannel];
|
||||
SQL = [NSString stringWithFormat: @"INSERT INTO %@"
|
||||
@" (c_object, c_uid, c_role)"
|
||||
@" VALUES ('/%@', '%@', '%@')", [folder aclTableName],
|
||||
[objectPathArray componentsJoinedByString: @"/"],
|
||||
uid, roles];
|
||||
[channel evaluateExpressionX: SQL];
|
||||
|
||||
userRoles = [roles objectEnumerator];
|
||||
currentRole = [userRoles nextObject];
|
||||
while (currentRole)
|
||||
{
|
||||
SQL = [NSString stringWithFormat: @"INSERT INTO %@"
|
||||
@" (c_object, c_uid, c_role)"
|
||||
@" VALUES ('/%@', '%@', '%@')", [folder aclTableName],
|
||||
[objectPathArray componentsJoinedByString: @"/"],
|
||||
uid, currentRole];
|
||||
[channel evaluateExpressionX: SQL];
|
||||
currentRole = [userRoles nextObject];
|
||||
}
|
||||
|
||||
[folder releaseChannel: channel];
|
||||
}
|
||||
|
||||
/* acls */
|
||||
- (NSString *) defaultAclRoles
|
||||
- (NSArray *) defaultAclRoles
|
||||
{
|
||||
#warning this should be changed to something useful
|
||||
return @"tourist";
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *) acls
|
||||
@@ -324,7 +332,7 @@
|
||||
forObjectAtPath: [self pathArrayToSoObject]];
|
||||
}
|
||||
|
||||
- (void) setRoles: (NSString *) roles
|
||||
- (void) setRoles: (NSArray *) roles
|
||||
forUser: (NSString *) uid
|
||||
{
|
||||
return [self setRoles: roles
|
||||
|
||||
Reference in New Issue
Block a user