mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 11:55:24 +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:
@@ -1,5 +1,12 @@
|
||||
2007-04-24 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoFolder.m ([SOGoFolder
|
||||
-setRoles:rolesforUser:uidforObjectAtPath:objectPathArray]): the
|
||||
"roles" parameter is now an NSArray instead of a string. Therefore
|
||||
we loop throughout the array to populate the table. All the
|
||||
relevant records are removed prior to the addition of the new
|
||||
rights.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailBaseObject.m ([SOGoMailBaseObject
|
||||
-aclsForUser:uid]): new override that returns nil until we add
|
||||
support for IMAP acls.
|
||||
|
||||
@@ -307,12 +307,6 @@
|
||||
|
||||
/* acls */
|
||||
|
||||
- (NSString *) defaultAclRoles
|
||||
{
|
||||
#warning this should be changed to something useful
|
||||
return @"tourist";
|
||||
}
|
||||
|
||||
- (NSArray *) acls
|
||||
{
|
||||
return [container aclsForObjectAtPath: [self pathArrayToSoObject]];
|
||||
@@ -324,7 +318,7 @@
|
||||
forObjectAtPath: [self pathArrayToSoObject]];
|
||||
}
|
||||
|
||||
- (void) setRoles: (NSString *) roles
|
||||
- (void) setRoles: (NSArray *) roles
|
||||
forUser: (NSString *) uid
|
||||
{
|
||||
return [container setRoles: roles
|
||||
|
||||
+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
|
||||
|
||||
@@ -88,10 +88,10 @@
|
||||
|
||||
/* acls */
|
||||
|
||||
- (NSString *) defaultAclRoles;
|
||||
- (NSArray *) defaultAclRoles;
|
||||
- (NSArray *) acls;
|
||||
- (NSArray *) aclsForUser: (NSString *) uid;
|
||||
- (void) setRoles: (NSString *) roles
|
||||
- (void) setRoles: (NSArray *) roles
|
||||
forUser: (NSString *) uid;
|
||||
- (void) removeAclsForUsers: (NSArray *) users;
|
||||
|
||||
|
||||
@@ -706,14 +706,14 @@ static BOOL kontactGroupDAV = YES;
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *) defaultAclRoles
|
||||
- (NSArray *) defaultAclRoles
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) setRoles: (NSString *) roles
|
||||
- (void) setRoles: (NSArray *) roles
|
||||
forUser: (NSString *) uid
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
Reference in New Issue
Block a user