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 current user for generic object methods #16120

Merged
merged 1 commit into from
Oct 6, 2017
Merged

Set current user for generic object methods #16120

merged 1 commit into from
Oct 6, 2017

Conversation

jntullo
Copy link

@jntullo jntullo commented Oct 4, 2017

Required for ManageIQ/manageiq-api#93, follow up to #16089

This change allows setting of the current user so that the API has the ability to queue generic object methods and have them run successfully.

@miq-bot enhancement, automate
@miq-bot assign @mkanoor

@miq-bot
Copy link
Member

miq-bot commented Oct 4, 2017

@jntullo unrecognized command 'enhancement', ignoring...

Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

@mkanoor
Copy link
Contributor

mkanoor commented Oct 5, 2017

👍
Lucy can you review

@mkanoor mkanoor requested a review from lfu October 5, 2017 18:54
describe 'property methods without user set' do
it 'will set the current user' do
workspace = double("MiqAeWorkspaceRuntime", :root => {"method_result" => "result"})
User.current_user = user
Copy link
Contributor

Choose a reason for hiding this comment

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

@jntullo
Instead of setting the User.current_user could you use User.with_user_group(user, group) { spec commands }
akin to https://github.com/ManageIQ/manageiq/blob/master/spec/lib/rbac/filterer_spec.rb#L185

@miq-bot
Copy link
Member

miq-bot commented Oct 5, 2017

Checked commit jntullo@53faffd with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@mkanoor mkanoor merged commit c312d93 into ManageIQ:master Oct 6, 2017
@mkanoor mkanoor added this to the Sprint 71 Ending Oct 16, 2017 milestone Oct 6, 2017
@chrisarcand chrisarcand deleted the go_set_current_user branch November 28, 2017 19:28
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