Project

General

Profile

Bug #15236

No permissions for power, puppetrun e.t.c in API

Added by Shimon Shtein over 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Hosts
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1341149
Description of problem:

Host's special actions will fail with "Unknown permission" exception

Example:

[root@xyz ~]# curl --insecure -X PUT -d '{"power_action": "state"}' -u admin:changeme -H "Content-Type:application/json" -H "Accept:application/json" https://abc.redhat.com/api/v2/hosts/abc1.redhat.com/power {
"error": {"message":"ERF42-5531 [Foreman::Exception]: unknown permission for api/v2/hosts#power"}
}

Additional info:

Katello is redefining #action_permission method in katello/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb which means that the original host's method is not called.
In foreman this method defines a lot of special actions.

Associated revisions

Revision 5d553340 (diff)
Added by Shimon Shtein over 2 years ago

Fixes #15236 - Use alias_method_chain for permissions (#6087)

History

#1 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6087 added

#2 Updated by Shimon Shtein over 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Eric Helms over 2 years ago

  • Legacy Backlogs Release (now unused) set to 143

Also available in: Atom PDF