myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3114] branches/events/lib/rest.rb: updated REST


From: noreply
Subject: [myexperiment-hackers] [3114] branches/events/lib/rest.rb: updated REST for authorised activities
Date: Sat, 25 Aug 2012 15:30:38 +0000 (UTC)

Revision
3114
Author
dgc
Date
2012-08-25 15:30:38 +0000 (Sat, 25 Aug 2012)

Log Message

updated REST for authorised activities

Modified Paths

Diff

Modified: branches/events/lib/rest.rb (3113 => 3114)


--- branches/events/lib/rest.rb	2012-08-25 13:41:30 UTC (rev 3113)
+++ branches/events/lib/rest.rb	2012-08-25 15:30:38 UTC (rev 3114)
@@ -1123,10 +1123,10 @@
 
     if success
       case "#{action} #{new_version || edit_version}"
-      when "create false": Activity.create(:subject => opts[:user], :action ="" 'create', :objekt => ob)
-      when "create true":  Activity.create(:subject => opts[:user], :action ="" 'create version', :objekt => ob)
-      when "edit false":   Activity.create(:subject => opts[:user], :action ="" 'edit', :objekt => ob)
-      when "edit true":    Activity.create(:subject => opts[:user], :action ="" 'edit version', :objekt => ob, :extra => ob.version)
+      when "create false": Activity.create(:subject => opts[:user], :action ="" 'create', :objekt => ob, :auth => ob)
+      when "create true":  Activity.create(:subject => opts[:user], :action ="" 'create', :objekt => ob.versions.last, :auth => ob)
+      when "edit false":   Activity.create(:subject => opts[:user], :action ="" 'edit', :objekt => ob, :auth => ob)
+      when "edit true":    Activity.create(:subject => opts[:user], :action ="" 'edit', :objekt => ob, :extra => ob.version, :auth => ob.workflow)
       end
     end
 
@@ -1263,10 +1263,10 @@
 
     if success
       case "#{action} #{new_version || edit_version}"
-      when "create false": Activity.create(:subject => opts[:user], :action ="" 'create', :objekt => ob)
-      when "create true":  Activity.create(:subject => opts[:user], :action ="" 'create version', :objekt => ob)
-      when "edit false":   Activity.create(:subject => opts[:user], :action ="" 'edit', :objekt => ob)
-      when "edit true":    Activity.create(:subject => opts[:user], :action ="" 'edit version', :objekt => ob, :extra => ob.version)
+      when "create false": Activity.create(:subject => opts[:user], :action ="" 'create', :objekt => ob, :auth => ob)
+      when "create true":  Activity.create(:subject => opts[:user], :action ="" 'create', :objekt => ob.versions.last, :auth => ob)
+      when "edit false":   Activity.create(:subject => opts[:user], :action ="" 'edit', :objekt => ob, :auth => ob)
+      when "edit true":    Activity.create(:subject => opts[:user], :action ="" 'edit', :objekt => ob, :extra => ob.version, :auth => ob.blob)
       end
     end
 

reply via email to

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