Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable to add a new Group after first unsuccessful adding #3164

Merged
merged 1 commit into from Jan 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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