From 1585f25c2b950d8d99116f4b9ab92836b2924aec Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 20 Jul 2010 18:50:12 +0000 Subject: [PATCH] Monotone-Parent: 6a3c0d744d66748f11759bba747978f5e50b85d5 Monotone-Revision: 6c3973de5dad3f2478a806c7eb196f3a1a7d66a8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-07-20T18:50:12 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoUserFolder.m | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a968aa3a..ba867bdc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-07-20 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUserFolder.m (_subFoldersFromFolder:): we + need to validate the current user's access to the listed folders + again because of the recent changes on SOGoParentFolder. + * UI/Contacts/UIxContactFoldersView.m (_subFoldersFromFolder:): removed unused method. diff --git a/SoObjects/SOGo/SOGoUserFolder.m b/SoObjects/SOGo/SOGoUserFolder.m index e029e2c94..072ebb7b0 100644 --- a/SoObjects/SOGo/SOGoUserFolder.m +++ b/SoObjects/SOGo/SOGoUserFolder.m @@ -27,6 +27,7 @@ #import #import +#import #import #import #import @@ -147,18 +148,27 @@ NSMutableArray *folders; NSEnumerator *subfolders; SOGoFolder *currentFolder; - NSString *folderName; + NSString *folderName, *folderOwner; Class subfolderClass; NSMutableDictionary *currentDictionary; + SoSecurityManager *securityManager; folders = [NSMutableArray array]; + folderOwner = [parentFolder ownerInContext: context]; + securityManager = [SoSecurityManager sharedSecurityManager]; + subfolderClass = [[parentFolder class] subFolderClass]; subfolders = [[parentFolder subFolders] objectEnumerator]; while ((currentFolder = [subfolders nextObject])) { - if ([currentFolder isMemberOfClass: subfolderClass]) + if (![securityManager validatePermission: SOGoPerm_AccessObject + onObject: currentFolder + inContext: context] + && [[currentFolder ownerInContext: context] + isEqualToString: folderOwner] + && [currentFolder isMemberOfClass: subfolderClass]) { folderName = [NSString stringWithFormat: @"/%@/%@", [parentFolder nameInContainer],