Skip to content

Commit

Permalink
Add RBAC for Containers Images Scan/Check compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
PanSpagetka committed Apr 24, 2017
1 parent 1895ce6 commit 715c98d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/mixins/containers_common_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def button
def scan_images
assert_privileges("image_scan")
showlist = @lastaction == "show_list"
ids = showlist ? find_checked_items : find_current_item(ContainerImage)
ids = showlist ? find_checked_ids_with_rbac(ContainerImage) : find_current_item(ContainerImage)

if ids.empty?
add_flash(_("No %{model} were selected for Analysis") % {:model => ui_lookup(:tables => "container_image")},
Expand All @@ -50,7 +50,7 @@ def scan_images
def check_compliance(model)
assert_privileges("#{model.name.underscore}_check_compliance")
showlist = @lastaction == "show_list"
ids = showlist ? find_checked_items : find_current_item(model)
ids = showlist ? find_checked_ids_with_rbac(model) : find_current_item(model)

if ids.empty?
add_flash(_("No %{model} were selected for %{task}") % {:model => ui_lookup(:models => model.to_s),
Expand All @@ -68,7 +68,7 @@ def find_current_item(model)
add_flash(_("%{model} no longer exists") % {:model => ui_lookup(:model => model.to_s)}, :error)
[]
else
[params[:id].to_i]
[find_id_with_rbac(model, params[:id].to_i)]
end
end

Expand Down

0 comments on commit 715c98d

Please sign in to comment.