diff --git a/ChangeLog b/ChangeLog index 5d58c3b62..0496bec98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-04-17 Wolfgang Sourdeau + * 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. diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index d2e9829e9..aaa1f86d7 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -19,18 +19,23 @@ 02111-1307, USA. */ +#import +#import +#import +#import +#import #import -#import "AgenorUserManager.h" -#import "SOGoAclsFolder.h" -#import "common.h" +#import +#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; }