Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1497073

Summary: Can't edit host collection if permission is limited to a edit_host_collections
Product: Red Hat Satellite Reporter: Ranjan Kumar <rankumar>
Component: Host CollectionsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.11CC: bbuckingham, bkearney, ehelms, jsherril, nkathole
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.4.5.52-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
screenshot of UI none

Description Ranjan Kumar 2017-09-29 06:59:05 UTC
Description of problem: Unable to edit host collection with the permission  edit_host_collections


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


How reproducible: Always


Steps to Reproduce:
1. Create a new role with permission view_hosts and edit_host_collections
2. Assign this role to any user
3. There is no edit link for Name, description and Content Host Limit

Actual results: User with edit_host_collections permission should have right to edit the host collection


Expected results: should able to edit host collection


Additional info:

Comment 1 Satellite Program 2017-09-29 16:12:08 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21156 has been resolved.

Comment 3 Nikhil Kathole 2017-10-09 10:11:30 UTC
FailedQA

Version Tested:
Satellite-6.3 Snap 19

steps:

1. Created role with view_host_collections, edit_host_collections
2. Created user with this role
3. Login with created user

Not able to edit host collection's Name, description and Content Host Limit.

Comment 4 Nikhil Kathole 2017-10-09 10:12:02 UTC
Created attachment 1336295 [details]
screenshot of UI

Comment 6 Bryan Kearney 2018-01-03 18:00:55 UTC
moving back to ON_DEV, it looks like the cherry pick did not happen.

Comment 7 Nikhil Kathole 2018-01-10 09:10:59 UTC
FailedQA

Version Tested:
Satellite-6.3 Snap 31

steps:

Followed same steps as per comment #3.

Still not able to edit host collection's Name, description and Content Host Limit from UI.

logs in production.log ===>

2018-01-10 03:50:47 04a9773f [app] [I] Started GET "/host-collections/details/views/host-collection-details.html" for IP at 2018-01-10 03:50:47 -0500
2018-01-10 03:50:47 6edc0c78 [app] [I] Started GET "/host-collections/details/views/host-collection-info.html" for IP at 2018-01-10 03:50:47 -0500
2018-01-10 03:50:47 da7d7f28 [app] [I] Started GET "/layouts/details-page-with-breadcrumbs.html" for IP at 2018-01-10 03:50:47 -0500
2018-01-10 03:50:48 bbd94a2c [app] [I] Started GET "/layouts/partials/page-loading-indicator.html" for IP at 2018-01-10 03:50:48 -0500
2018-01-10 03:50:48 3f65ed83 [app] [I] Started GET "/layouts/partials/full-row-breadcrumbs.html" for IP at 2018-01-10 03:50:48 -0500
2018-01-10 03:50:48 d03b3d0f [app] [I] Started GET "/layouts/two-column-details.html" for IP at 2018-01-10 03:50:48 -0500
2018-01-10 03:50:48 dcb1b155 [app] [I] Started GET "/common/views/select-action-dropdown.html" for IP at 2018-01-10 03:50:48 -0500
2018-01-10 03:50:49 70965396 [app] [I] Started GET "/katello/api/v2/host_collections/2?fields=full" for IP at 2018-01-10 03:50:49 -0500
2018-01-10 03:50:49 70965396 [app] [I] Processing by Katello::Api::V2::HostCollectionsController#show as JSON
2018-01-10 03:50:49 70965396 [app] [I]   Parameters: {"fields"=>"full", "api_version"=>"v2", "id"=>"2"}
2018-01-10 03:50:49 70965396 [app] [I] Current user: host_collection (regular user)
2018-01-10 03:50:49 70965396 [app] [I] Expire fragment views/tabs_and_title_records-5 (0.3ms)
2018-01-10 03:50:49 624276d7 [app] [I] Started GET "/components/views/bst-resource-switcher.html" for IP at 2018-01-10 03:50:49 -0500
2018-01-10 03:50:49 24f8c4d3 [app] [I] Started GET "/components/views/bst-edit-text.html" for IP at 2018-01-10 03:50:49 -0500
2018-01-10 03:50:49 4c3732c6 [app] [I] Started GET "/components/views/bst-edit-textarea.html" for IP at 2018-01-10 03:50:49 -0500
2018-01-10 03:50:49 12ac1414 [app] [I] Started GET "/components/views/bst-edit-custom.html" for IP at 2018-01-10 03:50:49 -0500
2018-01-10 03:50:49 70965396 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.45/app/views/katello/api/v2/host_collections/show.json.rabl within katello/api/v2/layouts/resource (53.5ms)
2018-01-10 03:50:49 70965396 [app] [I] Completed 200 OK in 132ms (Views: 74.9ms | ActiveRecord: 14.6ms)
2018-01-10 03:50:49 6b2893f2 [app] [I] Started GET "/components/views/bst-edit.html" for IP at 2018-01-10 03:50:49 -0500
2018-01-10 03:50:50 fd1d31f6 [app] [I] Started GET "/components/views/bst-edit-save-cancel.html" for IP at 2018-01-10 03:50:50 -0500
2018-01-10 03:50:57 46820eb2 [app] [I] Started GET "/notification_recipients" for IP at 2018-01-10 03:50:57 -0500
2018-01-10 03:50:57 46820eb2 [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-01-10 03:50:57 46820eb2 [app] [I] Current user: host_collection (regular user)
2018-01-10 03:50:57 46820eb2 [app] [I] Expire fragment views/tabs_and_title_records-5 (0.1ms)
2018-01-10 03:50:57 46820eb2 [app] [I] Completed 200 OK in 29ms (Views: 0.2ms | ActiveRecord: 4.3ms)
2018-01-10 03:51:09 25d32b0f [app] [I] Started GET "/notification_recipients" for IP at 2018-01-10 03:51:09 -0500
2018-01-10 03:51:09 25d32b0f [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-01-10 03:51:09 25d32b0f [app] [I] Current user: host_collection (regular user)
2018-01-10 03:51:09 25d32b0f [app] [I] Expire fragment views/tabs_and_title_records-5 (0.1ms)
2018-01-10 03:51:09 25d32b0f [app] [I] Completed 200 OK in 25ms (Views: 0.1ms | ActiveRecord: 4.2ms)

It is working fine with CLI

# hammer -u host_collection -p changeme shell
Welcome to the hammer interactive shell
Type 'help' for usage information
hammer> host-collection list
---|------------------------|-------|------------
ID | NAME                   | LIMIT | DESCRIPTION
---|------------------------|-------|------------
2  | RHEL 6 Host collection | None  |
1  | RHEL 7 Host collection | None  |
---|------------------------|-------|------------
hammer> host-collection info --id 1
ID:          1
Name:        RHEL 7 Host collection
Limit:       None
Description:
Total Hosts: 0

hammer> host-collection update --new-name 'RHEL new' --id 1
Host collection updated
hammer> host-collection list
---|------------------------|-------|------------
ID | NAME                   | LIMIT | DESCRIPTION
---|------------------------|-------|------------
2  | RHEL 6 Host collection | None  |
1  | RHEL new               | None  |
---|------------------------|-------|------------

Comment 8 Justin Sherrill 2018-01-12 19:55:04 UTC
This shouldn't have been moved to ON_DEV without a cherry pick, moving to POST

Comment 10 Nikhil Kathole 2018-01-22 11:18:32 UTC
VERIFIED

Version tested:
Satellite 6.3 snap 33

Found able to edit host collection's Name, description and Content Host Limit with view_host_collections, edit_host_collections role filters.

2018-01-22 06:13:30 fe49862e [app] [I] Started PUT "/katello/api/v2/host_collections/2" for IP at 2018-01-22 06:13:30 -0500
2018-01-22 06:13:30 fe49862e [app] [I] Processing by Katello::Api::V2::HostCollectionsController#update as JSON
2018-01-22 06:13:30 fe49862e [app] [I]   Parameters: {"host_ids"=>[], "name"=>"RHEL 6 Host collection update", "organization_id"=>1, "max_hosts"=>nil, "description"=>nil, "total_hosts"=>0, "unlimited_hosts"=>true, "created_at"=>"2018-01-21 18:46:50 UTC", "updated_at"=>"2018-01-21 18:46:50 UTC", "id"=>"2", "permissions"=>{"deletable"=>false, "editable"=>true}, "api_version"=>"v2", "host_collection"=>{"id"=>"2", "name"=>"RHEL 6 Host collection update", "description"=>nil, "max_hosts"=>nil, "organization_id"=>1, "created_at"=>"2018-01-21 18:46:50 UTC", "updated_at"=>"2018-01-21 18:46:50 UTC", "unlimited_hosts"=>true, "host_ids"=>[]}}
2018-01-22 06:13:30 fe49862e [app] [I] Current user: host_collection (regular user)
2018-01-22 06:13:30 fe49862e [app] [I] Expire fragment views/tabs_and_title_records-4 (0.1ms)
2018-01-22 06:13:30 fe49862e [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.54/app/views/katello/api/v2/host_collections/show.json.rabl within katello/api/v2/layouts/resource (15.8ms)
2018-01-22 06:13:30 fe49862e [app] [I] Completed 200 OK in 57ms (Views: 11.1ms | ActiveRecord: 14.5ms)
2018-01-22 06:13:30 1a864563 [app] [I] Started GET "/notification_recipients" for IP at 2018-01-22 06:13:30 -0500
2018-01-22 06:13:30 1a864563 [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-01-22 06:13:30 1a864563 [app] [I] Current user: host_collection (regular user)
2018-01-22 06:13:30 1a864563 [app] [I] Expire fragment views/tabs_and_title_records-4 (0.1ms)
2018-01-22 06:13:30 1a864563 [app] [I] Completed 200 OK in 21ms (Views: 0.1ms | ActiveRecord: 3.9ms)

Comment 11 Satellite Program 2018-02-21 16:54:37 UTC
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/RHSA-2018:0336