diff --git a/ChangeLog b/ChangeLog index 3bbda7cf9..504865448 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-03-25 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoGCSFolder.m ([SOGoGCSFolder + -davSetProperties:setPropsremovePropertiesNamed:removedPropsinContext:localContext]): + returns an exception if the property to modify is not + "davDisplayName" and if the current user has not the owner role + over the current collection. + 2008-03-18 Wolfgang Sourdeau * SoObjects/Appointments/SOGoAppointmentFolder.m diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 38a0c90d9..d7f6c6b71 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -528,12 +528,26 @@ static BOOL sendFolderAdvisories = NO; inContext: (WOContext *) localContext { NSString *newDisplayName; + NSException *exception; + NSArray *currentRoles; - newDisplayName = [setProps objectForKey: @"davDisplayName"]; - if ([newDisplayName length]) - [self renameTo: newDisplayName]; + currentRoles = [[localContext activeUser] rolesForObject: self + inContext: localContext]; + if ([currentRoles containsObject: SoRole_Owner]) + { + newDisplayName = [setProps objectForKey: @"davDisplayName"]; + if ([newDisplayName length]) + { + [self renameTo: newDisplayName]; + exception = nil; + } + else + exception = [NSException exceptionWithHTTPStatus: 404]; + } + else + exception = [NSException exceptionWithHTTPStatus: 403]; - return nil; + return exception; } /* acls as a container */