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

Scope User and MiqGroup searches within the current region #16756

Merged
merged 1 commit into from
Jan 5, 2018

Conversation

bdunne
Copy link
Member

@bdunne bdunne commented Jan 5, 2018

@bdunne bdunne requested a review from gmcculloug January 5, 2018 21:08
@bdunne bdunne force-pushed the scope_users_in_my_region branch from 9961b27 to 94cc845 Compare January 5, 2018 21:11
@@ -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?
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@bdunne bdunne force-pushed the scope_users_in_my_region branch from 94cc845 to faaf0f7 Compare January 5, 2018 21:22
@miq-bot
Copy link
Member

miq-bot commented Jan 5, 2018

Checked commit bdunne@faaf0f7 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 🍰

@@ -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?
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmcculloug
Copy link
Member

@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.

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@gmcculloug gmcculloug self-assigned this Jan 5, 2018
@gmcculloug gmcculloug merged commit 57dac5a into ManageIQ:master Jan 5, 2018
@gmcculloug gmcculloug added this to the Sprint 77 Ending Jan 15, 2018 milestone Jan 5, 2018
@bdunne bdunne deleted the scope_users_in_my_region branch January 5, 2018 22:54
simaishi pushed a commit that referenced this pull request Jan 8, 2018
Scope User and MiqGroup searches within the current region
(cherry picked from commit 57dac5a)

https://bugzilla.redhat.com/show_bug.cgi?id=1532327
@simaishi
Copy link
Contributor

simaishi commented Jan 8, 2018

Gaprindashvili backport details:

$ git log -1
commit fafb59fdcbefb84fd8522e1edc8d6262de656a89
Author: Greg McCullough <[email protected]>
Date:   Fri Jan 5 17:54:40 2018 -0500

    Merge pull request #16756 from bdunne/scope_users_in_my_region
    
    Scope User and MiqGroup searches within the current region
    (cherry picked from commit 57dac5a20f453f7b80d9a6910969566aa791316f)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1532327

simaishi pushed a commit that referenced this pull request Jan 10, 2018
Scope User and MiqGroup searches within the current region
(cherry picked from commit 57dac5a)

https://bugzilla.redhat.com/show_bug.cgi?id=1532328
@simaishi
Copy link
Contributor

Fine backport details:

$ git log -1
commit fdf0ac9251bd17dcf42e2c753273e35260d51f9f
Author: Greg McCullough <[email protected]>
Date:   Fri Jan 5 17:54:40 2018 -0500

    Merge pull request #16756 from bdunne/scope_users_in_my_region
    
    Scope User and MiqGroup searches within the current region
    (cherry picked from commit 57dac5a20f453f7b80d9a6910969566aa791316f)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1532328

d-m-u pushed a commit to d-m-u/manageiq that referenced this pull request Jun 6, 2018
Scope User and MiqGroup searches within the current region
(cherry picked from commit 57dac5a)

https://bugzilla.redhat.com/show_bug.cgi?id=1532328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants