-
Notifications
You must be signed in to change notification settings - Fork 897
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
Scope User and MiqGroup searches within the current region #16756
Conversation
9961b27
to
94cc845
Compare
app/models/user.rb
Outdated
@@ -107,7 +107,7 @@ def validate | |||
def current_group_by_description=(group_description) | |||
if group_description | |||
desired_group = miq_groups.detect { |g| g.description == group_description } | |||
desired_group ||= MiqGroup.find_by(:description => group_description) if super_admin_user? | |||
desired_group ||= MiqGroup.in_my_region.find_by(:description => group_description) if super_admin_user? |
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.
Does it make more sense for the find_by
call to happen in the region of the user instead of just the current region?
@gtanzillo Any thoughts on this one?
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.
done.
94cc845
to
faaf0f7
Compare
Checked commit bdunne@faaf0f7 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@@ -107,7 +107,7 @@ def validate | |||
def current_group_by_description=(group_description) | |||
if group_description | |||
desired_group = miq_groups.detect { |g| g.description == group_description } | |||
desired_group ||= MiqGroup.find_by(:description => group_description) if super_admin_user? | |||
desired_group ||= MiqGroup.in_region(region_id).find_by(:description => group_description) if super_admin_user? |
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.
Is there a reason why you used in_region here instead of in_my_region?
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.
What GM said...
@gtanzillo My initial comment is here #16756 (review). I suggested that the group should be scoped to the region of the user instead of the current region. |
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.
LGTM 👍
Scope User and MiqGroup searches within the current region (cherry picked from commit 57dac5a) https://bugzilla.redhat.com/show_bug.cgi?id=1532327
Gaprindashvili backport details:
|
Scope User and MiqGroup searches within the current region (cherry picked from commit 57dac5a) https://bugzilla.redhat.com/show_bug.cgi?id=1532328
Fine backport details:
|
Scope User and MiqGroup searches within the current region (cherry picked from commit 57dac5a) https://bugzilla.redhat.com/show_bug.cgi?id=1532328
https://bugzilla.redhat.com/show_bug.cgi?id=1529995