-
Notifications
You must be signed in to change notification settings - Fork 898
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
Conversation
spec/models/miq_request_spec.rb
Outdated
it "stays with the requester group" do | ||
expect(user.current_group).to eq(group1) | ||
expect(request.get_user.current_group).to eq(group2) | ||
end |
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.
@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
da8fa87
to
97b099d
Compare
Checked commit lfu@97b099d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Set user's group to the requester group. (cherry picked from commit 1d2c55f) https://bugzilla.redhat.com/show_bug.cgi?id=1480007
Fine backport details:
|
Set user's group to the requester group. (cherry picked from commit 1d2c55f) https://bugzilla.redhat.com/show_bug.cgi?id=1481859
Euwe backport details:
|
…7364 Set user's group to the requester group. (cherry picked from commit 1d2c55f) https://bugzilla.redhat.com/show_bug.cgi?id=1480007
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