Monotone-Parent: 27aea167b22f4039327617a920f320773435357a

Monotone-Revision: 47696beae1f727f105c84083c575020ef044e2b6

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-11-26T20:41:59
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau committed 2007-11-26 20:41:59 +00:00
1 parent 1bf613706d
commit 04e82c1971
12 files changed
+252 -77

No files matched your search

+19 -7
View File
@@ -24,6 +24,8 @@
#import <NGObjWeb/NSException+HTTP.h>
#import <NGObjWeb/SoClassSecurityInfo.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSObject+Logs.h>
#import <Appointments/SOGoAppointmentFolders.h>
@@ -64,12 +66,18 @@
- (NSArray *) toManyRelationshipKeys
{
static NSArray *children = nil;
NSMutableArray *children;
SOGoUser *currentUser;
if (!children)
children = [[NSArray alloc] initWithObjects:
@"Calendar", @"Contacts", @"Mail",
@"Preferences", nil];
children = [NSMutableArray arrayWithCapacity: 4];
currentUser = [context activeUser];
if ([currentUser canAccessModule: @"Calendar"])
[children addObject: @"Calendar"];
[children addObject: @"Contacts"];
if ([currentUser canAccessModule: @"Mail"])
[children addObject: @"Mail"];
[children addObject: @"Preferences"];
return children;
}
@@ -149,12 +157,15 @@
acquire: (BOOL) _flag
{
id obj;
SOGoUser *currentUser;
/* first check attributes directly bound to the application */
obj = [super lookupName: _key inContext: _ctx acquire: NO];
if (!obj)
{
if ([_key isEqualToString: @"Calendar"])
currentUser = [_ctx activeUser];
if ([_key isEqualToString: @"Calendar"]
&& [currentUser canAccessModule: _key])
obj = [self privateCalendars: @"Calendar" inContext: _ctx];
// if (![_key isEqualToString: @"Calendar"])
// obj = [obj lookupName: [_key pathExtension]
@@ -163,7 +174,8 @@
obj = [self privateContacts: _key inContext: _ctx];
// else if ([_key isEqualToString: @"Groups"])
// obj = [self groupsFolder: _key inContext: _ctx];
else if ([_key isEqualToString: @"Mail"])
else if ([_key isEqualToString: @"Mail"]
&& [currentUser canAccessModule: _key])
obj = [self mailAccountsFolder: _key inContext: _ctx];
else if ([_key isEqualToString: @"Preferences"])
obj = [$(@"SOGoPreferencesFolder") objectWithName: _key