Skip to content

Commit

Permalink
Merge pull request #900 from romanblanco/fix_rbac_ops_rbac
Browse files Browse the repository at this point in the history
Corrected RBAC checks for checked items in ops controller
  • Loading branch information
martinpovolny authored Apr 4, 2017
2 parents fc9c9d7 + d4e7977 commit c39dab0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/ops_controller/ops_rbac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def rbac_tenant_edit
when "reset", nil # Reset or first time in
obj = find_checked_items
obj[0] = params[:id] if obj.blank? && params[:id]
@tenant = params[:typ] == "new" ? Tenant.new : Tenant.find(obj[0]) # Get existing or new record
@tenant = params[:typ] == "new" ? Tenant.new : find_checked_records_with_rbac(Tenant, obj).first # Get existing or new record

# This is only because ops_controller tries to set form locals, otherwise we should not use the @edit variable
@edit = {:tenant_id => @tenant.id}
Expand Down Expand Up @@ -211,7 +211,7 @@ def rbac_tenant_manage_quotas
when "reset", nil # Reset or first time in
obj = find_checked_items
obj[0] = params[:id] if obj.blank? && params[:id]
@tenant = Tenant.find(obj[0]) # Get existing or new record
@tenant = find_checked_records_with_rbac(Tenant, obj).first # Get existing or new record
# This is only because ops_controller tries to set form locals, otherwise we should not use the @edit variable
@edit = {:tenant_id => @tenant.id}
session[:edit] = {:key => "tenant_manage_quotas__#{@tenant.id}"}
Expand Down

0 comments on commit c39dab0

Please sign in to comment.