Monotone-Parent: 824371ebd82eb64fbd4854a807301e4626264817

Monotone-Revision: 64856d66db3bd10685a7bc471daa3e09652c6f11

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-03-29T17:20:37
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-03-29 17:20:37 +00:00
parent 1f7b31046e
commit a21e2d39f1
4 changed files with 90 additions and 1 deletions
+6 -1
View File
@@ -1,4 +1,9 @@
2007-03-29 Wolfgang Sourdeau <Wolfgang@Contre.COM>
2007-03-29 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Common/UIxFolderActions.m ([UIxFolderActions
-activateFolderAction]): new method that change the "active"
settings in the folder-related fields in the user settings.
([UIxFolderActions -deactivateFolderAction]): see above.
* UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView
-checkRightsAction]): removed method.
+3
View File
@@ -45,6 +45,9 @@
- (WOResponse *) subscribeAction;
- (WOResponse *) unsubscribeAction;
- (WOResponse *) canAccessContentAction;
- (WOResponse *) activateFolderAction;
- (WOResponse *) deactivateFolderAction;
@end
+66
View File
@@ -28,15 +28,20 @@
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WOResponse.h>
#import <NGObjWeb/SoSecurityManager.h>
#import <SOGo/AgenorUserManager.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoObject.h>
#import <SOGo/SOGoPermissions.h>
#import "UIxFolderActions.h"
@implementation UIxFolderActions
#warning some of this code could probably be moved in one of the \
clientObject classes...
- (void) _setupContext
{
NSString *clientClass;
@@ -134,4 +139,65 @@
return [self _realActionWithFolderName: nil];
}
- (WOResponse *) canAccessContentAction
{
WOResponse *response;
SoSecurityManager *securityManager;
BOOL result;
securityManager = [SoSecurityManager sharedSecurityManager];
result = (![securityManager validatePermission: SoPerm_AccessContentsInformation
onObject: [self clientObject]
inContext: context]);
response = [context response];
[response setStatus: 200];
[response setHeader: @"text/plain; charset=\"ascii\""
forKey: @"content-type"];
[response appendContentString: (result) ? @"1" : @"0"];
return response;
}
- (WOResponse *) _realFolderActivation: (BOOL) makeActive
{
WOResponse *response;
NSMutableDictionary *folderSubscription, *folderDict;
NSNumber *active;
response = [context response];
[self _setupContext];
active = [NSNumber numberWithBool: makeActive];
if ([owner isEqualToString: login])
[moduleSettings setObject: active forKey: @"activateUserFolder"];
else
{
folderSubscription
= [moduleSettings objectForKey: @"SubscribedFolders"];
if (folderSubscription)
{
folderDict = [folderSubscription objectForKey: subscriptionPointer];
if (folderDict)
[folderDict setObject: active
forKey: @"active"];
}
}
[ud synchronize];
[response setStatus: 204];
return response;
}
- (WOResponse *) activateFolderAction
{
return [self _realFolderActivation: YES];
}
- (WOResponse *) deactivateFolderAction
{
return [self _realFolderActivation: NO];
}
@end
+15
View File
@@ -42,6 +42,21 @@
actionClass = "UIxFolderActions";
actionName = "unsubscribe";
};
canAccessContent = {
protectedBy = "View";
actionClass = "UIxFolderActions";
actionName = "canAccessContent";
};
activateFolder = {
protectedBy = "View";
actionClass = "UIxFolderActions";
actionName = "activateFolder";
};
deactivateFolder = {
protectedBy = "View";
actionClass = "UIxFolderActions";
actionName = "deactivateFolder";
};
acls = {
protectedBy = "ReadAcls";
pageName = "UIxAclEditor";