Skip to content

Commit

Permalink
Enable to add a new Group after first unsuccessful adding
Browse files Browse the repository at this point in the history
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1523214

Enable to add a new Group after first unsuccessful adding of the Group
because of missing Name, in Administrator > Configuration, Access Control
tab > Groups.
  • Loading branch information
hstastna committed Jan 4, 2018
1 parent e463032 commit 76b8fa1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/ops_controller/ops_rbac.rb
Expand Up @@ -726,7 +726,7 @@ def rbac_edit_save_or_add(what, rbac_suffix = what)
when :group then
record = @edit[:group_id] ? MiqGroup.find_by(:id => @edit[:group_id]) : MiqGroup.new
validated = rbac_group_validate?
rbac_group_set_record_vars(record)
rbac_group_set_record_vars(record) if validated
when :role then
record = @edit[:role_id] ? MiqUserRole.find_by(:id => @edit[:role_id]) : MiqUserRole.new
validated = rbac_role_validate?
Expand Down Expand Up @@ -1421,6 +1421,7 @@ def rbac_role_validate?

# Validate some of the role fields
def rbac_group_validate?
return false if @edit[:new][:description].nil?
@assigned_filters = [] if @edit[:new][:filters].empty? || @edit[:new][:use_filter_expression]
@filter_expression = [] if @edit[:new][:filter_expression].empty? || @edit[:new][:use_filter_expression] == false
if @edit[:new][:role].nil? || @edit[:new][:role] == ""
Expand Down

0 comments on commit 76b8fa1

Please sign in to comment.