Darryl L. Pierce
2008-Aug-25 20:20 UTC
[Ovirt-devel] [PATCH] While testing a patch, I accidentally deleted the very last Super Admin
This patch fixes the small check in the permission_controller that allows deleting the primary record; i.e., the record that does not inherit from another permission. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- wui/src/app/controllers/permission_controller.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/wui/src/app/controllers/permission_controller.rb b/wui/src/app/controllers/permission_controller.rb index 813d9d9..5d3646d 100644 --- a/wui/src/app/controllers/permission_controller.rb +++ b/wui/src/app/controllers/permission_controller.rb @@ -102,7 +102,7 @@ class PermissionController < ApplicationController Permission.transaction do permissions = Permission.find(:all, :conditions => "id in (#{permission_ids.join(', ')})") permissions.each do |permission| - permission.destroy if permission.is_primary? + permission.destroy unless permission.is_primary? end end render :json => { :object => "permission", :success => true, -- 1.5.5.1