Monotone-Parent: 581e13f64111105e0bce624d9e6267f5eb79f46d

Monotone-Revision: 7a02739cae6babfe41777a34b6d6949a9385d396

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-04-22T14:50:40
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-04-22 14:50:40 +00:00
parent 9b5bac6d26
commit 52098ec649
3 changed files with 40 additions and 39 deletions
+15 -6
View File
@@ -260,16 +260,25 @@ static BOOL sendFolderAdvisories = NO;
- (NSException *) setDavDisplayName: (NSString *) newName
{
NSException *error;
NSArray *currentRoles;
if ([newName length])
currentRoles = [[context activeUser] rolesForObject: self
inContext: context];
if ([currentRoles containsObject: SoRole_Owner])
{
[self renameTo: newName];
error = nil;
if ([newName length])
{
[self renameTo: newName];
error = nil;
}
else
error = [NSException exceptionWithHTTPStatus: 400
reason: [NSString stringWithFormat:
@"Empty string"]];
}
else
error = [NSException exceptionWithHTTPStatus: 400
reason: [NSString stringWithFormat:
@"Empty string"]];
error = [NSException exceptionWithHTTPStatus: 403
reason: @"Modification denied."];
return error;
}