mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-07 09:25:09 +00:00
Monotone-Parent: b760d621e7a6656db365f14583da4ff33c68c87b
Monotone-Revision: 40771f087f196edd3af10cf4202e2ce91e3c9f58 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-15T22:45:30 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -169,22 +169,25 @@
|
||||
- (NSString *) roleOfUser: (NSString *) uid
|
||||
inContext: (WOContext *) context
|
||||
{
|
||||
NSArray *roles;
|
||||
NSArray *roles, *traversalPath;
|
||||
NSString *objectName, *role;
|
||||
|
||||
role = nil;
|
||||
objectName = [[context objectForKey: @"SoRequestTraversalPath"]
|
||||
objectAtIndex: 2];
|
||||
if ([objectName isEqualToString: @"personal"])
|
||||
traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
|
||||
if ([traversalPath count] > 1)
|
||||
{
|
||||
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;
|
||||
objectName = [traversalPath objectAtIndex: 2];
|
||||
if ([objectName isEqualToString: @"personal"])
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
return role;
|
||||
|
||||
@@ -184,23 +184,26 @@
|
||||
- (NSString *) roleOfUser: (NSString *) uid
|
||||
inContext: (WOContext *) context
|
||||
{
|
||||
NSArray *roles;
|
||||
NSArray *roles, *traversalPath;
|
||||
NSString *objectName, *role;
|
||||
|
||||
role = nil;
|
||||
objectName = [[context objectForKey: @"SoRequestTraversalPath"]
|
||||
objectAtIndex: 1];
|
||||
if ([objectName isEqualToString: @"Calendar"]
|
||||
|| [objectName isEqualToString: @"Contacts"])
|
||||
traversalPath = [context objectForKey: @"SoRequestTraversalPath"];
|
||||
if ([traversalPath count] > 1)
|
||||
{
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
return role;
|
||||
|
||||
Reference in New Issue
Block a user