Monotone-Parent: d4fe11d5b3be05fe97dd5cd1971bc2db2b20a75c

Monotone-Revision: 321895620e6004eb8531368e2dcdf24c7b8313fe

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-04-17T14:34:31
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-04-17 14:34:31 +00:00
parent a6ab235d1e
commit 9936eb9b79
2 changed files with 15 additions and 14 deletions
+5
View File
@@ -1,5 +1,10 @@
2007-04-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoUser.m ([SOGoUser
-rolesForObject:objectinContext:context]): no longer query objects
for "roleForUser:". Instead, all objects should implement
"rolesForUser:".
* SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject -acls]):
new method to comply with the new acl "protocol" in SOGoObject.
Uses SOGoFolder's new facilities for ACLS.
+10 -14
View File
@@ -19,18 +19,23 @@
02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSNull.h>
#import <Foundation/NSTimeZone.h>
#import <Foundation/NSUserDefaults.h>
#import <NGObjWeb/WOApplication.h>
#import <NGObjWeb/SoObject.h>
#import "AgenorUserManager.h"
#import "SOGoAclsFolder.h"
#import "common.h"
#import <NGExtensions/NSNull+misc.h>
#import "AgenorUserManager.h"
#import "SOGoContentObject.h"
#import "SOGoUser.h"
#import "SOGoPermissions.h"
static NSTimeZone *serverTimeZone = nil;
@interface NSObject (SOGoRoles)
- (NSString *) roleOfUser: (NSString *) uid;
- (NSArray *) rolesOfUser: (NSString *) uid;
@end
@@ -246,7 +251,6 @@ static NSTimeZone *serverTimeZone = nil;
inContext: (WOContext *) context
{
NSMutableArray *rolesForObject;
SOGoAclsFolder *aclsFolder;
NSArray *sogoRoles;
NSString *role;
@@ -261,9 +265,7 @@ static NSTimeZone *serverTimeZone = nil;
[rolesForObject addObject: SoRole_Owner];
if ([object isKindOfClass: [SOGoObject class]])
{
aclsFolder = [SOGoAclsFolder aclsFolder];
sogoRoles = [aclsFolder aclsForObject: (SOGoObject *) object
forUser: login];
sogoRoles = [(SOGoObject *) object aclsForUser: login];
if (sogoRoles)
[rolesForObject addObjectsFromArray: sogoRoles];
}
@@ -273,12 +275,6 @@ static NSTimeZone *serverTimeZone = nil;
if (sogoRoles)
[rolesForObject addObjectsFromArray: sogoRoles];
}
if ([object respondsToSelector: @selector (roleOfUser:)])
{
role = [object roleOfUser: login];
if (role)
[rolesForObject addObject: role];
}
return rolesForObject;
}