diff --git a/ChangeLog b/ChangeLog index fa46cd56d..6ccbac434 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-12-15 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUserFolder.m: same as for SOGoContactFolders + below, but for the Contacts and Calendar collections. + * SoObjects/SOGo/SOGoAclsFolder.m: convert the class to user the new acl facilities method from sope-gdl/GCSFolder.m. diff --git a/SoObjects/SOGo/SOGoUserFolder.m b/SoObjects/SOGo/SOGoUserFolder.m index c52cec8f4..b24dd0e3d 100644 --- a/SoObjects/SOGo/SOGoUserFolder.m +++ b/SoObjects/SOGo/SOGoUserFolder.m @@ -27,6 +27,7 @@ #import "Appointments/SOGoFreeBusyObject.h" #import "Contacts/SOGoContactFolders.h" #import "Mailer/SOGoMailAccounts.h" +#import "SOGoPermissions.h" #import "SOGoUserFolder.h" @@ -180,6 +181,31 @@ return obj; } +- (NSString *) roleOfUser: (NSString *) uid + inContext: (WOContext *) context +{ + NSArray *roles; + NSString *objectName, *role; + + role = nil; + objectName = [[context objectForKey: @"SoRequestTraversalPath"] + objectAtIndex: 1]; + if ([objectName isEqualToString: @"Calendar"] + || [objectName isEqualToString: @"Contacts"]) + { + roles = [[context activeUser] + rolesForObject: [self lookupName: objectName + inContext: context + acquire: NO] + inContext: context]; + if ([roles containsObject: SOGoRole_Assistant] + || [roles containsObject: SOGoRole_Delegate]) + role = SOGoRole_Assistant; + } + + return role; +} + /* WebDAV */ - (NSArray *) fetchContentObjectNames