]> err.no Git - scalable-opengroupware.org/blobdiff - UI/SOGoUI/UIxComponent.m
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1287 d1b88da0-ebda-0310...
[scalable-opengroupware.org] / UI / SOGoUI / UIxComponent.m
index efbe22c9125959a6e3ac0340ce77ae2533b38c6e..50e6bf253c28cc32521870927b9aae8003c7bafd 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
@@ -475,12 +489,6 @@ static BOOL uixDebugEnabled = NO;
   if ([lTable hasPrefix:@"$"])
     lTable = [self valueForKeyPath:[lTable substringFromIndex:1]];
   
-#if 0
-  if ([lVal hasPrefix:@"$"])
-    lVal = [self valueForKeyPath:[lVal substringFromIndex:1]];
-  
-#endif
-  
   /* lookup string */
   return [rm stringForKey: lKey
              inTableNamed: lTable