2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
26 @implementation SoUser
28 - (id)initWithLogin:(NSString *)_login roles:(NSArray *)_roles {
33 if ((self = [super init])) {
34 self->login = [_login copy];
35 self->roles = [_roles copy];
40 return [self initWithLogin:nil roles:nil];
44 [self->login release];
45 [self->roles release];
57 - (NSArray *)rolesInContext:(id)_ctx {
61 - (NSArray *)rolesForObject:(id)_object inContext:(id)_ctx {
62 NSArray *aroles, *localRoles;
64 aroles = [self rolesInContext:_ctx];
65 if (aroles == nil) aroles = [NSArray array];
68 TODO: collect all local roles (of the object and its parents, local
69 roles are stored in __ac_local_roles__ of the object in Zope. Note
70 that this attribute can be a callable returning the roles !
79 - (NSString *)description {
82 ms = [NSMutableString stringWithCapacity:16];
83 [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
84 [ms appendFormat:@" login=%@", self->login];
85 [ms appendFormat:@" roles=%@", [self->roles componentsJoinedByString:@","]];
86 [ms appendString:@">"];