Monotone-Parent: 22d8f930ef0774232d40575f91fe4eb49c980bd6

Monotone-Revision: 4c641cc8cb0c4617186e4139ce2c11f856fbbbf7

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-04-21T23:03:48
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-04-21 23:03:48 +00:00
parent 5c8298b730
commit 74d8080342
36 changed files with 1270 additions and 135 deletions
+51
View File
@@ -1342,4 +1342,55 @@ static BOOL sendACLAdvisories = NO;
return r;
}
- (NSException *) _setDavProperty: (NSString *) property
toValue: (id) newValue
{
NSException *exception;
SEL methodSel;
methodSel = NSSelectorFromString ([property davSetterName]);
if ([self respondsToSelector: methodSel])
exception = [self performSelector: methodSel
withObject: newValue];
else
exception
= [NSException exceptionWithHTTPStatus: 404
reason: [NSString stringWithFormat:
@"Property '%@' cannot be set.",
property]];
return exception;
}
- (NSException *) davSetProperties: (NSDictionary *) setProps
removePropertiesNamed: (NSDictionary *) removedProps
inContext: (WOContext *) localContext
{
NSString *currentProp;
NSException *exception;
NSArray *currentRoles;
NSEnumerator *properties;
id currentValue;
currentRoles = [[localContext activeUser] rolesForObject: self
inContext: localContext];
if ([currentRoles containsObject: SoRole_Owner])
{
properties = [[setProps allKeys] objectEnumerator];
exception = nil;
while (!exception
&& (currentProp = [properties nextObject]))
{
currentValue = [setProps objectForKey: currentProp];
exception = [self _setDavProperty: currentProp
toValue: currentValue];
}
}
else
exception = [NSException exceptionWithHTTPStatus: 403
reason: @"Modification denied."];
return exception;
}
@end /* SOGoObject */