From 07a725073003ec7df75f68475075dba3063e3d31 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 15 Dec 2006 22:22:32 +0000 Subject: [PATCH] Monotone-Parent: a8ff5d618705954a1e2ccfddf45142f36cab5a29 Monotone-Revision: ff214773dda1a075605ffce354878b51039fe0fb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-15T22:22:32 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/SOGo/SOGoUserFolder.m | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) 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