Mailinglist Archive: opensuse-buildservice (258 mails)

< Previous Next >
[opensuse-buildservice] [PATCH] Unable to delete user via API
  • From: "Srinidhi B" <srinidhi@xxxxxxxxxx>
  • Date: Sun, 08 Aug 2010 13:38:45 -0600
  • Message-id: <4C5F551D020000550005F7CA@xxxxxxxxxxxxxxxxxxxxx>
Hi,

If you try to delete a user from the api (Rails app), you will get a message
saying:

"You sent an invalid request!"

After looking at api/app/controllers/active_rbac/user_controller.rb, I found
that you can only POST to destroy and can only GET on delete.

So here's another trivial patch that allows deletion of users from the Rails
app.

Srinidhi.

diff --git a/src/api/app/views/active_rbac/user/delete.rhtml
b/src/api/app/views/active_rbac/user/delete.rhtml
index 90025b2..cf6b983 100644
--- a/src/api/app/views/active_rbac/user/delete.rhtml
+++ b/src/api/app/views/active_rbac/user/delete.rhtml
@@ -7,7 +7,7 @@ depending on this user (articles, for example).
<strong>This action cannot be reverted!</strong>
</p>

-<% form_for :group, :url => { :action => :delete, :id => @user } do |form| %>
+<% form_for :group, :url => { :action => :destroy, :id => @user } do |form| %>
<%= submit_tag 'Yes', :name => 'yes' %>
<%= submit_tag 'No', :name => 'no' %>
-<% end %>
\ No newline at end of file
+<% end %>

--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups