Project

General

Profile

Actions

Bug #14535

closed

/api/smart_class_parameters needs administrator permissions

Added by Sander Hoentjen about 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Users, Roles and Permissions
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

It seems that since Foreman version 1.10 (at least 1.10.3) I need to give a user administrator permissions to access /api/smart_class_parameters
Is this by design?
I also can't seem to limit access to a specific search on "Lookup key" anymore, is this by design?


Related issues 3 (0 open3 closed)

Related to Foreman - Refactor #10832: Make LookupKey an STI for puppet and variable keysClosedTom Caspy06/16/2015Actions
Related to Foreman - Bug #14546: No ability to restrict *_external_variables with search anymoreClosedOri Rabin04/08/2016Actions
Related to Foreman - Bug #15321: Cannot save smart parameter bookmarksResolved06/07/2016Actions
Actions #1

Updated by Dominic Cleal about 8 years ago

  • Category set to Users, Roles and Permissions
  • Status changed from New to Need more information

The *_external_variables permissions should give access to this API, please check you've assigned it to the user. If that doesn't work, please attach production.log during the access, with debugging and the permissions logger enabled: http://theforeman.org/manuals/1.10/index.html#7.2Debugging

Actions #2

Updated by Sander Hoentjen about 8 years ago

Dominic Cleal wrote:

The *_external_variables permissions should give access to this API, please check you've assigned it to the user.

Yes, I have assigned those. With 1.9 I used search for that as well, so to be sure I removed and re-added the permissions but without any success.

2016-04-08 11:29:33 [app] [I] Started GET "/api/smart_class_parameters?search=key+%3D+some_key+and+puppetclass+%3D+some%3A%3Aclass" for 10.99.0.232 at 2016-04-08 11:29:33 +0200
2016-04-08 11:29:33 [app] [I] Processing by Api::V2::SmartClassParametersController#index as JSON
2016-04-08 11:29:33 [app] [I] Parameters: {"search"=>"key = some_key and puppetclass = some::class", "apiv"=>"v2", "smart_class_parameter"=>{}}
2016-04-08 11:29:33 [app] [I] Authorized user some_user(Some User)

2016-04-08 11:29:33 [permissions] [D] checking permission view_external_variables
2016-04-08 11:29:33 [permissions] [D]
2016-04-08 11:29:33 [permissions] [D] no filters found for given permission
2016-04-08 11:29:33 [permissions] [D] checking permission view_external_variables
2016-04-08 11:29:33 [permissions] [D]
2016-04-08 11:29:33 [permissions] [D] no filters found for given permission
2016-04-08 11:29:33 [app] [I] Rendered api/v2/smart_class_parameters/index.json.rabl within api/v2/layouts/index_layout (10.4ms)
2016-04-08 11:29:33 [permissions] [D] checking permission view_external_variables
2016-04-08 11:29:33 [permissions] [D]
2016-04-08 11:29:33 [permissions] [D] no filters found for given permission

Actions #3

Updated by Dominic Cleal about 8 years ago

  • Related to Refactor #10832: Make LookupKey an STI for puppet and variable keys added
Actions #4

Updated by Dominic Cleal about 8 years ago

  • Subject changed from /api/smart_class_parameters needs administrator permissions? to /api/smart_class_parameters needs administrator permissions
  • Status changed from Need more information to New

The authorisation step is checking for a resource type that doesn't match what's stored in the seeded permissions, it's looking up: permissions.resource_type = 'PuppetclassLookupKey'. Prior to #10832, the resource type would always be LookupKey, but db/seeds.d/03-permissions.rb isn't updated with the new PuppetLookupKey/VariableLookupKey resource types.

Actions #5

Updated by Dominic Cleal about 8 years ago

  • Related to Bug #14546: No ability to restrict *_external_variables with search anymore added
Actions #6

Updated by The Foreman Bot almost 8 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Ori Rabin
  • Pull request https://github.com/theforeman/foreman/pull/3530 added
Actions #7

Updated by Ori Rabin almost 8 years ago

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

Updated by Dominic Cleal almost 8 years ago

  • translation missing: en.field_release set to 136
Actions #9

Updated by Tomer Brisker over 7 years ago

  • Related to Bug #15321: Cannot save smart parameter bookmarks added
Actions

Also available in: Atom PDF