Red Hat Bugzilla – Bug 1230884
hammer role filter does work with ID but not with name
Last modified: 2017-02-23 14:56:11 EST
Description of problem: Using hammer CLI permissions could be assigned using the permission ID but not names: [dherrman@inf60 ~]$ hammer role create --name dhtest User role [dhtest] created [dherrman@inf60 ~]$ hammer filter create --permissions view_puppetclasses,create_puppetclasses,edit_puppetclasses,destroy_puppetclasses,import_puppetclasses --role dhtest Could not create the permission filter: Permissions Permissions must be of same resource type [dherrman@inf60 ~]$ hammer filter create --permission-ids 115,116,117,118,119 --role dhtest Permission filter for [Puppetclass] created Version-Release number of selected component (if applicable): 6.1.0 private beta and GA SNAP 8 How reproducible: See commands above Steps to Reproduce: 1. 2. 3. Actual results: Using names error message : Permissions Permissions must be of same resource type Expected results: Permissions added to this role Additional info:
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
Reassigning to Eric which already provided fix. To find ids of permissions you can use following hammer command hammer filter available-permissions The cause is that permissions controller didn't support searching of parameters by scoped search which hammer uses to resolve names to ids.
Moving to POST since upstream bug http://projects.theforeman.org/issues/11303 has been closed ------------- Eric Helms Applied in changeset commit:2dec184c083bb0e6a2404de30083f2d8aa491a96.
I can still see the original reported issue with sat6.1.2 snap1. Could not create the permission filter: Permissions Permissions must be of same resource type rubygem-hammer_cli_foreman-0.1.4.14-1.el7sat.noarch foreman-1.7.2.35-1.el7sat.noarch ruby193-rubygem-katello-2.2.0.67-1.el7sat.noarch katello-installer-2.3.18-1.el7sat.noarch rubygem-hammer_cli_katello-0.0.7.17-1.el7sat.noarch katello-2.2.0.15-1.el7sat.noarch
Upstream bug component is API
Using permission names: hammer> role create --name dhtest User role [dhtest] created hammer> filter create --permissions view_puppetclasses,create_puppetclasses,edit_puppetclasses,destroy_puppetclasses,import_puppetclasses --role dhtest Permission filter for [Puppetclass] created hammer> filter info --id 164 Id: 164 Resource type: Puppetclass Search: none Unlimited?: yes Role: dhtest Permissions: view_puppetclasses, create_puppetclasses, edit_puppetclasses, destroy_puppetclasses, import_puppetclasses Created at: 2015/10/05 20:02:40 Updated at: 2015/10/05 20:02:40 Using permission IDs: hammer> role create --name dhtest2 User role [dhtest2] created hammer> filter create --permission-ids 115,116,117,118,119 --role dhtest2 Permission filter for [Puppetclass] created hammer> filter info --id 165 Id: 165 Resource type: Puppetclass Search: none Unlimited?: yes Role: dhtest2 Permissions: view_puppetclasses, create_puppetclasses, edit_puppetclasses, destroy_puppetclasses, import_puppetclasses Created at: 2015/10/05 20:07:16 Updated at: 2015/10/05 20:07:16
Verified using Satellite-6.1.0-RHEL-7-20151002.0 compose/
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2015:1911