Project

General

Profile

Bug #11303

Filter management with hamemr seems to be missing means of associating resource type

Added by Greg Swift about 4 years ago. Updated about 1 year ago.

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

Description

I'm trying to manage creation of roles and their associated permissions. Haven't figured out how. This was as close as I could determine and it doesnt work.

hammer> filter create --role "Content Viewer" --permissions "view_gpg_keys,view_content_views" 
Could not create the permission filter:
  Permissions Permissions must be of same resource type

hammer> filter update --organization-ids 1 --id 76 --role "Content Viewer" --permissions view_products
Could not update the permission filter:
  Permissions Permissions must be of same resource type
  Organization ids You can't assign organizations to this resource

hammer> filter update --organization-ids 1 --id 76 --role "Content Viewer" --permissions view_products -^t^t
--help               --location-ids       --organization-ids   --permission-ids     --role               --search             
--id                 --locations          --organizations      --permissions        --role-id            -h        

Related issues

Related to Hammer CLI - Bug #11441: Hammer does not check whether it get correct number of resources when translating name to id parametersNew2015-08-20

Associated revisions

Revision 2dec184c (diff)
Added by Eric Helms almost 4 years ago

Fixes #11303: Allow scoped search by name for permissions.

This both provides this functionality and fixes an issue with creating
filters using hammer. Hammer attempts to search for a permission by
name using scoped search syntax when creating a filter with the
--permission=view_domains style syntax. However, this was defaulting to
returning all permissions instead of scoped permissions.

History

#1 Updated by The Foreman Bot about 4 years ago

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

#2 Updated by Eric Helms about 4 years ago

After some investigation this appears to be an error with the expectation of hammer when providing a permission name to go and search the API for a permission with the name supplied by the user. However, permissions aren't currently outfitted for scoped search usage and thus all permissions are returned and a filter is attempted to be created with them and thus the error mentioned is generated.

#3 Updated by Eric Helms about 4 years ago

  • Project changed from Katello to Foreman
  • Category deleted (Hammer)

#4 Updated by Marek Hulán about 4 years ago

  • Related to Bug #11441: Hammer does not check whether it get correct number of resources when translating name to id parameters added

#5 Updated by Marek Hulán about 4 years ago

  • Category set to API
  • Assignee set to Eric Helms
  • Bugzilla link set to 1230884

#6 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 63

#7 Updated by Eric Helms almost 4 years ago

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

Also available in: Atom PDF