Use post method instead of get method when invoking the unsetup method from the api...
[arvados.git] / apps / workbench / app / controllers / users_controller.rb
index 35c9660d6ccdf55a29b165efecd3cb402ceb9e96..a98bb11a99f54010359415fe270896cfa2e064e6 100644 (file)
@@ -1,7 +1,7 @@
 class UsersController < ApplicationController
   skip_before_filter :find_object_by_uuid, :only => [:welcome, :activity]
   skip_around_filter :thread_with_mandatory_api_token, :only => :welcome
-  before_filter :ensure_current_user_is_admin, only: :sudo
+  before_filter :ensure_current_user_is_admin, only: [:sudo, :unsetup]
 
   def welcome
     if current_user
@@ -137,4 +137,12 @@ class UsersController < ApplicationController
       f.html { render template: 'users/home' }
     end
   end
+
+  def unsetup
+    if current_user.andand.is_admin
+      @object.unsetup @object
+    end
+    show
+  end
+
 end