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

Fixes #25745 - fix permission lookup on custom actions #6359

Merged
merged 1 commit into from Dec 31, 2018

Conversation

Projects
None yet
3 participants
@ares
Copy link
Member

commented Dec 20, 2018

To reproduce:

  1. setup org, user who's not admin but has permisson in this org (e.g. assign him to org and assign Manager role
  2. have a VM on any compute resource so you can call power on and power off the host
  3. run this command hammer host stop --id 1 --organization-id 1 where 1 is id of that VM

you'll get the error of parent permission, the problem is that if we specify organization, since the route is /organization/1/host/1/, we try to verify permission for the organization. But we don't know what permission.

So this adds the missing mapping between parent resource permission and custom host actions. For powering host, view organization permission is required.

I don't think we should add a test that verifies this definition. The logic for checking parent permission is being tested already.

@theforeman-bot

This comment has been minimized.

Copy link
Member

commented Dec 20, 2018

Issues: #25745

@ares

This comment has been minimized.

Copy link
Member Author

commented Dec 24, 2018

[test foreman]

@tbrisker
Copy link
Member

left a comment

Thanks @ares !

@tbrisker tbrisker merged commit 77b316f into theforeman:develop Dec 31, 2018

6 of 7 checks passed

katello Build finished. 4117 tests run, 9 skipped, 0 failed.
Details
Hound No violations found. Woof!
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
foreman Build finished. 36191 tests run, 15 skipped, 0 failed.
Details
prprocessor Commit message style is correct
Details
upgrade Build finished. No test results found.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.