From 44190a2103fffdd8543892b61aa67aa8fbe1d122 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 9 Nov 2007 16:40:15 +0000 Subject: [PATCH] Monotone-Parent: 3b8627a8b52c86d059ada9c0387459d8654bb482 Monotone-Revision: 66fe156475b1f789bc5d20c857350ca9afea9556 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-09T16:40:15 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Contacts/product.plist | 17 +---------------- UI/SOGoUI/UIxComponent.m | 20 +++++++++++++++++--- UI/Templates/ContactsUI/UIxContactEditor.wox | 11 ++++++----- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac03ed80d..6ed072424 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 1168ddcf2..1b4d7eb3c 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"; + protectedBy = ""; pageName = "UIxContactEditor"; }; -/* save = { - protectedBy = "View"; - pageName = "UIxContactEditor"; - actionName = "save"; - }; - write = { - protectedBy = "View"; - pageName = "UIxContactEditor"; - actionName = "write"; - }; */ }; }; }; diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index efbe22c91..a376ba607 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 #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 af3e3b025..fa69e46dd 100644 --- a/UI/Templates/ContactsUI/UIxContactEditor.wox +++ b/UI/Templates/ContactsUI/UIxContactEditor.wox @@ -335,11 +335,12 @@
- +