From bce1177499f971684b3950fb714b4db836040b77 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 16 Feb 2007 16:55:48 +0000 Subject: [PATCH] Monotone-Parent: 2d1ca1ccfa858d6badd46ed9adcc4f390f22125b Monotone-Revision: 4f3f7bdb86b48a58239e187db6765aa85a571d56 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-02-16T16:55:48 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoUser.m | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f48afafb5..5f811c70f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-02-16 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUser.m ([SOGoUser + -rolesForObject:objectinContext:context]): test for + "rolesOfUser:inContext:" in addition to "roleOfUser:...". + * SoObjects/Appointments/SOGoCalendarComponent.m ([SOGoCalendarComponent -rolesOfUser:logininContext:context]): returns the roles of the user on the container object if the event diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 4292e7b91..0c7a3947f 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -30,6 +30,8 @@ - (NSString *) roleOfUser: (NSString *) uid inContext: (WOContext *) context; +- (NSArray *) rolesOfUser: (NSString *) uid + inContext: (WOContext *) context; @end @@ -159,7 +161,14 @@ aclsFolder = [SOGoAclsFolder aclsFolder]; sogoRoles = [aclsFolder aclsForObject: (SOGoObject *) object forUser: login]; - [rolesForObject addObjectsFromArray: sogoRoles]; + if (sogoRoles) + [rolesForObject addObjectsFromArray: sogoRoles]; + } + if ([object respondsToSelector: @selector (rolesOfUser:inContext:)]) + { + sogoRoles = [object rolesOfUser: login inContext: context]; + if (sogoRoles) + [rolesForObject addObjectsFromArray: sogoRoles]; } if ([object respondsToSelector: @selector (roleOfUser:inContext:)]) {