From 823db80b8dba5142bc4794dd3b796a517eb1c329 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 25 Mar 2008 20:34:56 +0000 Subject: [PATCH] Monotone-Parent: 773965cc12e1e34ce72a11b7b25f3ff6e0dc7887 Monotone-Revision: 18368f64b51826fda4f9240e4e2ee6e766ae16ed Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-03-25T20:34:56 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ SoObjects/SOGo/SOGoGCSFolder.m | 22 ++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) 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 */