mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-05 20:10:33 +00:00
SoObjects/Appointments/GNUmakefile
Monotone-Parent: 18c8420c0a0c752ea4dd761f934a473b321568f8 Monotone-Revision: b2699a981cd5458fbd1da1a9a72992020a29a4fc Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-14T21:20:13 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -19,9 +19,19 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "SOGoUser.h"
|
||||
#include <SOGo/AgenorUserManager.h>
|
||||
#include "common.h"
|
||||
#import <NGObjWeb/SoObject.h>
|
||||
#import "AgenorUserManager.h"
|
||||
#import "SOGoAclsFolder.h"
|
||||
#import "common.h"
|
||||
|
||||
#import "SOGoUser.h"
|
||||
|
||||
@interface NSObject (SOGoRoles)
|
||||
|
||||
- (NSString *) roleOfUser: (NSString *) uid
|
||||
inContext: (WOContext *) context;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SOGoUser
|
||||
|
||||
@@ -131,4 +141,35 @@
|
||||
return folder;
|
||||
}
|
||||
|
||||
- (NSArray *) rolesForObject: (NSObject *) object
|
||||
inContext: (WOContext *) context
|
||||
{
|
||||
NSMutableArray *rolesForObject;
|
||||
SOGoAclsFolder *aclsFolder;
|
||||
NSArray *sogoRoles;
|
||||
NSString *role;
|
||||
|
||||
rolesForObject
|
||||
= [NSMutableArray arrayWithArray: [super rolesForObject: object
|
||||
inContext: context]];
|
||||
if ([[object ownerInContext: context] isEqualToString: [self login]])
|
||||
[rolesForObject addObject: SoRole_Owner];
|
||||
if ([object isKindOfClass: [SOGoObject class]])
|
||||
{
|
||||
aclsFolder = [SOGoAclsFolder new];
|
||||
sogoRoles = [aclsFolder aclsForObject: (SOGoObject *) object
|
||||
forUser: login];
|
||||
[rolesForObject addObjectsFromArray: sogoRoles];
|
||||
[aclsFolder release];
|
||||
}
|
||||
if ([object respondsToSelector: @selector (roleOfUser:inContext:)])
|
||||
{
|
||||
role = [object roleOfUser: login inContext: context];
|
||||
if (role)
|
||||
[rolesForObject addObject: role];
|
||||
}
|
||||
|
||||
return rolesForObject;
|
||||
}
|
||||
|
||||
@end /* SOGoUser */
|
||||
|
||||
Reference in New Issue
Block a user