mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-25 16:33:22 +00:00
Monotone-Parent: 01ccf525a7c4b4290cf3f8cbe10dbecae92c26ec
Monotone-Revision: 4aa0c2e4faed6ef081103161e7bf29d4f76520eb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-07-15T17:02:57 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -392,23 +392,8 @@ static SoSecurityManager *sm = nil;
|
||||
obj = [super lookupName: name inContext: lookupContext acquire: NO];
|
||||
if (!obj)
|
||||
{
|
||||
// Lookup in personal folders
|
||||
error = [self initSubFolders];
|
||||
if (error)
|
||||
{
|
||||
[self errorWithFormat: @"a database error occured: %@", [error reason]];
|
||||
obj = [NSException exceptionWithHTTPStatus: 503];
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = [subFolders objectForKey: name];
|
||||
if (obj && ![self ignoreRights]
|
||||
&& [sm validatePermission: SOGoPerm_AccessObject
|
||||
onObject: obj
|
||||
inContext: context])
|
||||
obj = nil;
|
||||
}
|
||||
|
||||
obj = [self lookupPersonalFolder: name
|
||||
ignoringRights: NO];
|
||||
if (!obj)
|
||||
{
|
||||
// Lookup in subscribed folders
|
||||
@@ -426,6 +411,31 @@ static SoSecurityManager *sm = nil;
|
||||
return obj;
|
||||
}
|
||||
|
||||
- (id) lookupPersonalFolder: (NSString *) name
|
||||
ignoringRights: (BOOL) ignoreRights
|
||||
{
|
||||
NSException *error;
|
||||
id obj;
|
||||
|
||||
error = [self initSubFolders];
|
||||
if (error)
|
||||
{
|
||||
[self errorWithFormat: @"a database error occured: %@", [error reason]];
|
||||
obj = [NSException exceptionWithHTTPStatus: 503];
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = [subFolders objectForKey: name];
|
||||
if (obj && !ignoreRights && ![self ignoreRights]
|
||||
&& [sm validatePermission: SOGoPerm_AccessObject
|
||||
onObject: obj
|
||||
inContext: context])
|
||||
obj = nil;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
- (NSArray *) subFolders
|
||||
{
|
||||
NSMutableArray *ma;
|
||||
|
||||
Reference in New Issue
Block a user