diff --git a/ChangeLog b/ChangeLog index 3ad63ee74..7dd7a7f0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-06-02 Wolfgang Sourdeau + * SoObjects/Contacts/SOGoContactFolders.m (-appendSystemSources): + we now add public sources to the list of folders if and only if + the active user is the owner of the current parent folder. + * SoObjects/SOGo/SOGoWebAuthenticator.m (-userInContext): if the returned user has the login "anonymous", we return a corresponding instance of SOGoUser to make sure methods are never invoked on diff --git a/SoObjects/Contacts/SOGoContactFolders.m b/SoObjects/Contacts/SOGoContactFolders.m index 105e6149e..98197dfa6 100644 --- a/SoObjects/Contacts/SOGoContactFolders.m +++ b/SoObjects/Contacts/SOGoContactFolders.m @@ -58,18 +58,25 @@ NSEnumerator *sourceIDs; NSString *currentSourceID, *srcDisplayName, *domain; SOGoContactSourceFolder *currentFolder; + SOGoUser *currentUser; - domain = [[context activeUser] domain]; - um = [SOGoUserManager sharedUserManager]; - sourceIDs = [[um addressBookSourceIDsInDomain: domain] objectEnumerator]; - while ((currentSourceID = [sourceIDs nextObject])) + currentUser = [context activeUser]; + if (activeUserIsOwner + || [[currentUser login] + isEqualToString: [self ownerInContext: context]]) { - srcDisplayName = [um displayNameForSourceWithID: currentSourceID]; - currentFolder = [SOGoContactSourceFolder folderWithName: currentSourceID - andDisplayName: srcDisplayName - inContainer: self]; - [currentFolder setSource: [um sourceWithID: currentSourceID]]; - [subFolders setObject: currentFolder forKey: currentSourceID]; + domain = [currentUser domain]; + um = [SOGoUserManager sharedUserManager]; + sourceIDs = [[um addressBookSourceIDsInDomain: domain] objectEnumerator]; + while ((currentSourceID = [sourceIDs nextObject])) + { + srcDisplayName = [um displayNameForSourceWithID: currentSourceID]; + currentFolder = [SOGoContactSourceFolder folderWithName: currentSourceID + andDisplayName: srcDisplayName + inContainer: self]; + [currentFolder setSource: [um sourceWithID: currentSourceID]]; + [subFolders setObject: currentFolder forKey: currentSourceID]; + } } return nil;