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

Set user's group to the requester group. #15696

Merged
merged 1 commit into from
Aug 2, 2017

Conversation

lfu
Copy link
Member

@lfu lfu commented Jul 31, 2017

User's current group might have changed before the provision finishes.
So the user's current group from DB may be different from the user's group when the request is made.

Need to set the user's group back to requester group the user is in when the provision is submitted.
Therefore the provisioned instances may belong to the right user/group/tenant.

Includes ManageIQ/manageiq-content#156.
Includes ManageIQ/manageiq-automation_engine#61.

https://bugzilla.redhat.com/show_bug.cgi?id=1467364

@miq-bot assign @gmcculloug
@miq-bot add_label services, euwe/yes, fine/yes

@gmcculloug gmcculloug changed the title Set user's group to the requester group. [WIP] Set user's group to the requester group. Aug 1, 2017
@miq-bot miq-bot added the wip label Aug 1, 2017
@gmcculloug gmcculloug changed the title [WIP] Set user's group to the requester group. Set user's group to the requester group. Aug 2, 2017
@gmcculloug gmcculloug removed the wip label Aug 2, 2017
it "stays with the requester group" do
expect(user.current_group).to eq(group1)
expect(request.get_user.current_group).to eq(group2)
end
Copy link
Member

Choose a reason for hiding this comment

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

@lfu Can you also add a tests for the case where the user does not share a group with the options[:requester_group] value. In that case the user remains in their current group.

User's current group might have changed before the provision finishes.
So the user's current group from DB may be different from the user's group when the request is made.

Need to set the user's group back to requester group the user is in when the provision is submitted.
Therefore the provisioned instances may belong to the right user/group/tenant.

https://bugzilla.redhat.com/show_bug.cgi?id=1467364
@lfu lfu force-pushed the service_user_in_groups_1467364 branch from da8fa87 to 97b099d Compare August 2, 2017 18:52
@miq-bot
Copy link
Member

miq-bot commented Aug 2, 2017

Checked commit lfu@97b099d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

@gmcculloug gmcculloug merged commit 1d2c55f into ManageIQ:master Aug 2, 2017
@gmcculloug gmcculloug added this to the Sprint 66 Ending Aug 7, 2017 milestone Aug 2, 2017
@gmcculloug gmcculloug added the bug label Aug 9, 2017
simaishi pushed a commit that referenced this pull request Aug 9, 2017
@simaishi
Copy link
Contributor

simaishi commented Aug 9, 2017

Fine backport details:

$ git log -1
commit b5bfa9a483d00d150429a5738a3b27f1a8ef37c3
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Wed Aug 2 17:07:40 2017 -0400

    Merge pull request #15696 from lfu/service_user_in_groups_1467364
    
    Set user's group to the requester group.
    (cherry picked from commit 1d2c55f08a65a895059415cd829990c5c2db5f74)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1480007

@simaishi
Copy link
Contributor

Euwe backport details:

$ git log -1
commit c1c84e85f14677674001e2c15d245a0afbc4cad9
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Wed Aug 2 17:07:40 2017 -0400

    Merge pull request #15696 from lfu/service_user_in_groups_1467364
    
    Set user's group to the requester group.
    (cherry picked from commit 1d2c55f08a65a895059415cd829990c5c2db5f74)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1481859

@lfu lfu deleted the service_user_in_groups_1467364 branch October 16, 2017 20:15
d-m-u pushed a commit to d-m-u/manageiq that referenced this pull request Jun 6, 2018
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.

4 participants