-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fixed validation while adding user with multiple groups. #427
Conversation
req_attrs << "password" if ::Settings.authentication.mode == "database" | ||
bad_attrs = [] | ||
req_attrs.each { |attr| bad_attrs << attr if data[attr].blank? } | ||
bad_attrs << "group or miq_groups" if !data['group'] && !data['miq_groups'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abellotti @gtanzillo what do you think about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hyperkid123 , @skateman - @abellotti and I looked at this and we are both ok with this change. We would just need some tests before merging.
req_attrs << "password" if ::Settings.authentication.mode == "database" | ||
bad_attrs = [] | ||
req_attrs.each { |attr| bad_attrs << attr if data[attr].blank? } | ||
bad_attrs << "group or miq_groups" if !data['group'] && !data['miq_groups'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hyperkid123 , @skateman - @abellotti and I looked at this and we are both ok with this change. We would just need some tests before merging.
@gtanzillo i will add them in the morning :) |
be9ca6e
to
2071fbc
Compare
Checked commits Hyperkid123/manageiq-api@e479246~...2071fbc with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
There was a buggy validation while adding new user with multiple user groups. Attribute
name
was required even ifmiq_groups
was provided in data object.