-
Notifications
You must be signed in to change notification settings - Fork 985
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 #8812 - Pass model type so search_for is called on Host #2121
Conversation
There were the following issues with the commit message:
Guidelines are available on the Foreman wiki. This message was auto-generated by Foreman's prprocessor |
bbd9479
to
67def28
Compare
FYI it is not required to create new PR when rebasing. Feel free to force push into your existing branch, github handles this fine. |
@lzap I am not the author of the first PR, so I can not force push to someone else's repository. But I am really interested in getting that patch merged for 1.8/1.7..4 |
Oh sorry I missed that. Thanks for the contributions. I expect folks who were doing initial Later, |
[test] |
67def28
to
038b4d5
Compare
@domcleal Can you retrigger the tests? Thanks |
038b4d5
to
d0e2c5d
Compare
[test] |
@roidelapluie could you take at look at fixing the failing test? Thanks! |
[test] because of the latest enabled cops |
d0e2c5d
to
fba61fd
Compare
fba61fd
to
67c6c66
Compare
Would be great to see this in 1.8. |
[test] |
b8b95e3
to
fb3170d
Compare
fb3170d
to
c994ad6
Compare
@elobato I have written a test but I can not get it to work locally |
it does not work because in app/models/user.rb line 320 cached_roles.detect {|role| role.allowed_to?(action)}.present cached_roles is empty. i have no idea why. when I connect to the test server I see that my fixtures are correct. |
c994ad6
to
b827779
Compare
I tried and I'm not sure why I spent some time changing your code to use Factories and tests pass just fine 😄 , Here is the patch ! I think this is probably ready to merge after applying it. Apply it, let's see what Mr. Jenkins thinks and if it's a 🍏 let's Thanks again @roidelapluie ! |
There were the following issues with the commit message:
Guidelines are available on the Foreman wiki. This message was auto-generated by Foreman's prprocessor |
Merged your patch :) |
At least on version 1.6.1, the absence of this second parameter leads to a runtime crash when it's time to validate if the current user (non-admin) is allowed to perform a power operation on given a host via the APIv2. The root cause of the crash is basically that search_for is called on Host::Base by app/services/authorizer.rb:50.
948ab7a
to
d094e4e
Compare
@elobato :green: |
Merged as e02a2ff, thanks to @roidelapluie and special thanks to @nbarrientos for the original patch! |
This PR is a rebase of GH-2013
At least on version 1.6.1, the absence of this second parameter leads to a
runtime crash when it's time to validate if the current user (non-admin) is
allowed to perform a power operation on given a host via the APIv2.
The root cause of the crash is basically that search_for is called on
Host::Base by app/services/authorizer.rb:50.
Not sure this is necessary in newer versions, up to the developers to figure
it out :)