]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1258 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 9 Nov 2007 16:40:49 +0000 (16:40 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 9 Nov 2007 16:40:49 +0000 (16:40 +0000)
ChangeLog
UI/Contacts/product.plist
UI/SOGoUI/UIxComponent.m
UI/Templates/ContactsUI/UIxContactEditor.wox

index ac03ed80ddacd32a9c1a4943706c6d647e4a9752..6ed0724241c0896e09bd667003addb3d5e19846e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-11-09  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
+       * 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
index 1168ddcf25f954b2ffcb0bd8880f9b405b50a1fe..1b4d7eb3c6ca3d72b2947a0f5e83d27f5614340f 100644 (file)
              protectedBy = "<public>";
               pageName    = "UIxContactView";
            };
-/*           delete = {
-              protectedBy = "View";
-              pageName    = "UIxContactView";
-              actionName  = "delete";
-           }; */
            edit = {
-              protectedBy = "Access Contents Information";
-              pageName    = "UIxContactEditor";
-           };
-/*           save = {
-              protectedBy = "View";
+              protectedBy = "<public>";
               pageName    = "UIxContactEditor";
-              actionName  = "save";
            };
-           write = {
-              protectedBy = "View";
-              pageName    = "UIxContactEditor";
-              actionName  = "write";
-           }; */
         };
      };
   };
index efbe22c9125959a6e3ac0340ce77ae2533b38c6e..a376ba6077037e8eb5a9a2e31fba28501a1dd720 100644 (file)
 #import <NGExtensions/NSString+misc.h>
 #import <NGExtensions/NSURL+misc.h>
 
+#import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
+#import <SoObjects/SOGo/NSString+Utilities.h>
 #import <SoObjects/SOGo/SOGoUser.h>
 #import <SoObjects/SOGo/SOGoObject.h>
+#import <SoObjects/SOGo/SOGoContentObject.h>
 #import <SoObjects/SOGo/SOGoCustomGroupFolder.h>
-#import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
-#import <SoObjects/SOGo/NSString+Utilities.h>
+#import <SoObjects/SOGo/SOGoPermissions.h>
 
 #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
index af3e3b0250615789d7fa739e25fbff490cb98486..fa69e46dd8339cca8cb9d7497e460ff42b35a10d 100644 (file)
         </div>
       </div>
       <div id="buttons">
-        <input
-          type="submit"
-          class="button"
-          label:value="Save"
-          name="save:method" />
+       <var:if condition="canCreateOrModify"
+         ><input
+           type="submit"
+           class="button"
+           label:value="Save"
+           name="save:method" /></var:if>
         <input
           type="submit"
           class="button"