myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2189] trunk: added privileges to workflows, file


From: noreply
Subject: [myexperiment-hackers] [2189] trunk: added privileges to workflows, files and packs
Date: Fri, 8 May 2009 10:33:50 -0400 (EDT)

Revision
2189
Author
dgc
Date
2009-05-08 10:33:50 -0400 (Fri, 08 May 2009)

Log Message

added privileges to workflows, files and packs

Modified Paths

Diff

Modified: trunk/config/tables.xml


(Binary files differ)

Modified: trunk/lib/rest.rb (2188 => 2189)


--- trunk/lib/rest.rb	2009-05-07 13:03:50 UTC (rev 2188)
+++ trunk/lib/rest.rb	2009-05-08 14:33:50 UTC (rev 2189)
@@ -203,6 +203,10 @@
 
         element
 
+      when 'call'
+
+        eval("#{model_data['Accessor'][i]}(ob, user, query)")
+
       else 
 
         if model_data['Encoding'][i] == 'file-column'
@@ -1073,6 +1077,24 @@
   end
 end
 
+# Privileges
+
+def effective_privileges(ob, user, query)
+
+  privileges = XML::Node.new('privileges')
+
+  ['view', 'download', 'edit'].each do |type|
+    if Authorization.is_authorized?(type, nil, ob, user) 
+      privilege = XML::Node.new('privilege')
+      privilege['type'] = type
+
+      privileges << privilege
+    end
+  end
+
+  privileges
+end
+
 # Comments
 
 def comment_aux(action, req_uri, rules, user, query)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]