Monotone-Parent: c33c456b52c6e6d4ee1f29bfd9ca57096b8d13be

Monotone-Revision: 5539e3c473023281dd04f7cb8a8fee051ac0735d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-04-11T19:08:58
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-04-11 19:08:58 +00:00
parent 828d3b2818
commit e09ac2e383
32 changed files with 350 additions and 616 deletions
+42 -44
View File
@@ -67,10 +67,10 @@
return self;
}
- (SOGoGroupsFolder *) lookupGroupsFolder
{
return [self lookupName: @"Groups" inContext: nil acquire: NO];
}
// - (SOGoGroupsFolder *) lookupGroupsFolder
// {
// return [self lookupName: @"Groups" inContext: nil acquire: NO];
// }
/* pathes */
@@ -131,11 +131,11 @@
return contacts;
}
- (id) groupsFolder: (NSString *) _key
inContext: (WOContext *) _ctx
{
return [$(@"SOGoGroupsFolder") objectWithName: _key inContainer: self];
}
// - (id) groupsFolder: (NSString *) _key
// inContext: (WOContext *) _ctx
// {
// return [$(@"SOGoGroupsFolder") objectWithName: _key inContainer: self];
// }
- (id) mailAccountsFolder: (NSString *) _key
inContext: (WOContext *) _ctx
@@ -168,12 +168,12 @@
}
else if ([_key isEqualToString: @"Contacts"])
obj = [self privateContacts: _key inContext: _ctx];
else if ([_key isEqualToString: @"Groups"])
obj = [self groupsFolder: _key inContext: _ctx];
// else if ([_key isEqualToString: @"Groups"])
// obj = [self groupsFolder: _key inContext: _ctx];
else if ([_key isEqualToString: @"Mail"])
obj = [self mailAccountsFolder: _key inContext: _ctx];
else if ([_key isEqualToString: @"freebusy.ifb"])
obj = [self freeBusyObject:_key inContext:_ctx];
obj = [self freeBusyObject:_key inContext: _ctx];
else
obj = [NSException exceptionWithHTTPStatus: 404 /* Not Found */];
}
@@ -181,38 +181,38 @@
return obj;
}
/* FIXME: here is a vault of hackish ways to gain access to subobjects by
granting ro access to the homepage depending on the subobject in question.
This is wrong and dangerous. */
- (NSString *) roleOfUser: (NSString *) uid
inContext: (WOContext *) context
{
NSArray *roles, *traversalPath;
NSString *objectName, *role;
// /* FIXME: here is a vault of hackish ways to gain access to subobjects by
// granting ro access to the homepage depending on the subobject in question.
// This is wrong and dangerous. */
// - (NSString *) roleOfUser: (NSString *) uid
// inContext: (WOContext *) context
// {
// NSArray *roles, *traversalPath;
// NSString *objectName, *role;
role = nil;
traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
if ([traversalPath count] > 1)
{
objectName = [traversalPath objectAtIndex: 1];
if ([objectName isEqualToString: @"Calendar"]
|| [objectName isEqualToString: @"Contacts"])
{
roles = [[context activeUser]
rolesForObject: [self lookupName: objectName
inContext: context
acquire: NO]
inContext: context];
if ([roles containsObject: SOGoRole_Assistant]
|| [roles containsObject: SOGoRole_Delegate])
role = SOGoRole_Assistant;
}
else if ([objectName isEqualToString: @"freebusy.ifb"])
role = SOGoRole_Assistant;
}
// role = nil;
// traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
// if ([traversalPath count] > 1)
// {
// objectName = [traversalPath objectAtIndex: 1];
// if ([objectName isEqualToString: @"Calendar"]
// || [objectName isEqualToString: @"Contacts"])
// {
// roles = [[context activeUser]
// rolesForObject: [self lookupName: objectName
// inContext: context
// acquire: NO]
// inContext: context];
// if ([roles containsObject: SOGoRole_Assistant]
// || [roles containsObject: SOGoRole_Delegate])
// role = SOGoRole_Assistant;
// }
// else if ([objectName isEqualToString: @"freebusy.ifb"])
// role = SOGoRole_Assistant;
// }
return role;
}
// return role;
// }
/* WebDAV */
@@ -244,10 +244,8 @@
collections itself. So for use its the home folder, the
public folder and the groups folder.
*/
WOContext *context;
NSArray *tag;
context = [[WOApplication application] context];
tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
[self baseURLInContext: context], nil];