diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index d94487b75..34dad387a 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -169,7 +169,10 @@ static NSArray *childRecordFields = nil; [newFolder setOwner: login]; [newFolder setIsSubscription: localIsSubscription]; if (![newFolder displayName]) - newFolder = nil; + { + [self errorWithFormat: @"No displayName for %@", newFolder]; + newFolder = nil; + } return newFolder; } diff --git a/SoObjects/SOGo/SOGoParentFolder.m b/SoObjects/SOGo/SOGoParentFolder.m index 99b23006e..e20861d84 100644 --- a/SoObjects/SOGo/SOGoParentFolder.m +++ b/SoObjects/SOGo/SOGoParentFolder.m @@ -291,18 +291,28 @@ static SoSecurityManager *sm = nil; // This is important because user A could delete folder X, and user B has subscribed to it. // If the "default roles" are enabled for calendars/address books, -validatePermission:.. will // work (grabbing the default role) and the deleted resource will be incorrectly returned. - if (subscribedFolder - && [subscribedFolder ocsFolderForPath: [subscribedFolder ocsPath]] - && ![sm validatePermission: SOGoPerm_AccessObject - onObject: subscribedFolder - inContext: context]) + if (!subscribedFolder) { - [subscribedSubFolders setObject: subscribedFolder - forKey: [subscribedFolder nameInContainer]]; - return YES; + [self errorWithFormat: @"Can't find subscription %@", sourceKey]; + return NO; } - - return NO; + if (![subscribedFolder ocsFolderForPath: [subscribedFolder ocsPath]]) + { + [self errorWithFormat: @"Folder vanished for subscription %@", sourceKey]; + return NO; + } + if ([sm validatePermission: SOGoPerm_AccessObject + onObject: subscribedFolder + inContext: context]) + { + [self errorWithFormat: @"User %@ has no right to access %@", [[context activeUser] login], sourceKey]; + return NO; + } + + [subscribedSubFolders setObject: subscribedFolder + forKey: [subscribedFolder nameInContainer]]; + + return YES; } - (NSException *) appendSubscribedSources