Skip to content

Commit

Permalink
fixes #16997 - allow non-admin user to edit activation key
Browse files Browse the repository at this point in the history
This change is specifically to allow a non-admin user to
add/remove host collections from an activation key.

Example filter permissions:

Activation Keys -> view_activation_keys, create_activation_keys,
                   edit_activation_keys, destroy_activation_keys
Host Collections -> view_host_collections
  • Loading branch information
bbuckingham committed Oct 18, 2016
1 parent 883680d commit 3a2f003
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -19,14 +19,14 @@

<button ng-if="isState('activation-keys.details.host-collections.list')"
class="btn btn-default"
ng-hide="denied('edit_activation_key', activationKey)"
ng-hide="denied('edit_activation_keys', activationKey)"
ng-disabled="hostCollectionsTable.numSelected == 0 || hostCollectionsTable.working"
ng-click="removeHostCollections()">
{{ 'Remove Selected' | translate }}
</button>
<button ng-if="isState('activation-keys.details.host-collections.add')"
class="btn btn-default"
ng-hide="denied('edit_activation_key', activationKey)"
ng-hide="denied('edit_activation_keys', activationKey)"
ng-disabled="hostCollectionsTable.numSelected == 0 || hostCollectionsTable.working"
ng-click="addHostCollections()">
{{ 'Add Selected' | translate }}
Expand Down
4 changes: 3 additions & 1 deletion lib/katello/permissions/activation_key_permissions.rb
Expand Up @@ -14,7 +14,9 @@
:resource_type => 'Katello::ActivationKey'
permission :edit_activation_keys,
{
'katello/api/v2/activation_keys' => [:update, :content_override, :add_subscriptions, :remove_subscriptions]
'katello/api/v2/activation_keys' => [:update, :content_override,
:add_subscriptions, :remove_subscriptions,
:add_host_collections, :remove_host_collections]
},
:resource_type => 'Katello::ActivationKey'
permission :destroy_activation_keys,
Expand Down

0 comments on commit 3a2f003

Please sign in to comment.