Project

General

Profile

Bug #15225

Capsule import puppet classes per environment action permission error

Added by Tomer Brisker over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1337987
Description of problem:
Importing the puppet classes from a smart proxy per environment generates an action permission error:

[crash] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XPOST https://localhost/api/v2/smart_proxies/1/environments/29/import_puppetclasses {
"error": {"message":"ERF42-5531 [Foreman::Exception]: unknown permission for api/v2/environments#import_puppetclasses"}
}

2016-05-20 15:44:38 [app] [I] Started POST "/api/v2/smart_proxies/1/environments/29/import_puppetclasses" for 127.0.0.1 at
2016-05-20 15:44:38 +0000
2016-05-20 15:44:38 [app] [I] Processing by Api::V2::EnvironmentsController#import_puppetclasses as JSON
2016-05-20 15:44:38 [app] [I] Parameters: {"per_page"=>9999, "apiv"=>"v2", "smart_proxy_id"=>"1", "id"=>"29", "environmen
t"=>{}}
2016-05-20 15:44:38 [app] [I] Authorized user hoici(hoici )
2016-05-20 15:44:38 [app] [W] Action failed | Foreman::Exception: ERF42-5531 [Foreman::Exception]: unknown permission for api/v2/environments#import_puppetclasses | /usr/share/foreman/app/controllers/api/base_controller.rb:271:in `action_permission' | /usr/share/foreman/app/controllers/api/base_controller.rb:295:in `parent_resource_details' | /usr/share/foreman/app/controllers/api/base_controller.rb:220:in `find_nested_object' | /usr/share/foreman/app/controllers/api/base_controller.rb:214:in `find_optional_nested_object' | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:424:in `block in make_lamb
da'

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. API call to POST /api/smart_proxies/:smart_proxy_id/environments/:id/import_puppetclasses Import puppet classes from puppet Capsule for an environment
2.
3.

Actual results:
Error

Expected results:
Success

Additional info:

Associated revisions

Revision 1d308d0f (diff)
Added by Tomer Brisker over 3 years ago

Fixes #15225 - correct permission mapping for api puppet import

Revision 905077e9 (diff)
Added by Tomer Brisker over 3 years ago

Fixes #15225 - correct permission mapping for api puppet import

(cherry picked from commit 1d308d0f0023dfde054fa63cb6f33e3a35def23c)

Revision aa13ff53 (diff)
Added by Tomer Brisker over 3 years ago

Fixes #15225 - correct permission mapping for api puppet import

(cherry picked from commit 1d308d0f0023dfde054fa63cb6f33e3a35def23c)

History

#1 Updated by The Foreman Bot over 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3557 added

#2 Updated by Anonymous over 3 years ago

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

#3 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 159

Also available in: Atom PDF