-
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
Fix miq request ownership #18257
Fix miq request ownership #18257
Conversation
1cc1575
to
b1f7a3d
Compare
Checked commits kbrock/manageiq@c7d2cdc~...b1f7a3d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
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.
Looks great! Thanks for taking care of the @kbrock
@kbrock @gtanzillo |
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, thanks @kbrock
making a note to update factories in these specs when this(Support more regions in FactoryGirl's factories) will be merged (and other PR
s)
Fix miq request ownership (cherry picked from commit aa6fba5) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1647169
Hammer backport details:
|
Fix miq request ownership (cherry picked from commit aa6fba5) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1656170
Gaprindashvili backport details:
|
Overview
Currently, MiqRequests only show requests created in the same region.
This works most of the time except for a rollup (aka reporting) region.
You see, we have different user records for each region. They have the same
userid
(aka the string login name), but theid
is different.Requests created in this region are associated with the user from this region, and requests created in another region are associated with the user from the other region.
Followup to #18245 (added specs)
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1647169
Before
For the request screen, we only showed requests associated with the currently logged in user.
Requests from other regions were not associated with this user and did not show.
After
For the request screen, we now only show requests associated with the currently logged in
userid
(the string you use to login).Requests from other regions are associated with a different user, but the
userid
match, so they are now shown.The
OwnershipMixin
usesuserid
to store object ownership.The MiqRequest needed to overrides these methods since ownership is stored in
requester_id
.The new methods have been changed to still be based upon
requester_id
, but the code is now more similar to theOwnershipMixin
version.