From 87757acfbf0dc98062ba14fb0d16d8463298c07b Mon Sep 17 00:00:00 2001 From: wolfgang Date: Fri, 9 Nov 2007 16:40:49 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1258 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 4 ++++ UI/Contacts/product.plist | 17 +---------------- UI/SOGoUI/UIxComponent.m | 18 ++++++++++++++++-- UI/Templates/ContactsUI/UIxContactEditor.wox | 11 ++++++----- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac03ed80..6ed07242 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-11-09 Wolfgang Sourdeau + * UI/SOGoUI/UIxComponent.m ([UIxComponent -canCreateOrModify]): + new boolean accessor that determines whether someone can create + (i.e. modify a new entry) or modify an existing entry. + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -lookupName:lookupNameinContext:localContextacquire:acquire]): overriden method to bind looked up keys to So methods but by diff --git a/UI/Contacts/product.plist b/UI/Contacts/product.plist index 1168ddcf..1b4d7eb3 100644 --- a/UI/Contacts/product.plist +++ b/UI/Contacts/product.plist @@ -158,25 +158,10 @@ protectedBy = ""; pageName = "UIxContactView"; }; -/* delete = { - protectedBy = "View"; - pageName = "UIxContactView"; - actionName = "delete"; - }; */ edit = { - protectedBy = "Access Contents Information"; - pageName = "UIxContactEditor"; - }; -/* save = { - protectedBy = "View"; + protectedBy = ""; pageName = "UIxContactEditor"; - actionName = "save"; }; - write = { - protectedBy = "View"; - pageName = "UIxContactEditor"; - actionName = "write"; - }; */ }; }; }; diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index efbe22c9..a376ba60 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -35,11 +35,13 @@ #import #import +#import +#import #import #import +#import #import -#import -#import +#import #import "UIxJSClose.h" @@ -423,6 +425,18 @@ static BOOL uixDebugEnabled = NO; return jsClose; } +/* common conditions */ +- (BOOL) canCreateOrModify +{ + SoSecurityManager *sm; + + sm = [SoSecurityManager sharedSecurityManager]; + + return (![sm validatePermission: SoPerm_ChangeImagesAndFiles + onObject: [self clientObject] + inContext: context]); +} + /* SoUser */ - (NSString *) shortUserNameForDisplay diff --git a/UI/Templates/ContactsUI/UIxContactEditor.wox b/UI/Templates/ContactsUI/UIxContactEditor.wox index af3e3b02..fa69e46d 100644 --- a/UI/Templates/ContactsUI/UIxContactEditor.wox +++ b/UI/Templates/ContactsUI/UIxContactEditor.wox @@ -335,11 +335,12 @@
- +