Bug 2000063

Summary: Some of the filters permission needs to be clean
Product: Red Hat Satellite Reporter: Devendra Singh <desingh>
Component: Content ViewsAssignee: Partha Aji <paji>
Status: CLOSED ERRATA QA Contact: Devendra Singh <desingh>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.10.0CC: paji, pcreech, zhunting
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-4.1.1.35-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 14:13:42 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:

Description Devendra Singh 2021-09-01 09:53:00 UTC
Description of problem: Some of the filters permission needs to be clean


Version-Release number of selected component (if applicable):
6.10 Snap13

How reproducible:
always

Steps to Reproduce:
1. Prepare the satellite's base version using upgrade template
2. Collect the filter's cli data before the upgrade.

{'id': '219', 'resource type': 'organization', 'search': 'none', 'unlimited?': 'true', 'override?': 'false', 'role': 'manager', 'permissions': 'view_organizations, create_organizations, edit_organizations, destroy_organizations, assign_organizations, import_library_content, export_library_content'}

3. Run the upgrade
4. Collect the filter's cli data after the upgrade.
{'id': '219', 'resource type': 'organization', 'search': 'none', 'unlimited?': 'true', 'override?': 'false', 'role': 'manager', 'permissions': 'view_organizations, create_organizations, edit_organizations, destroy_organizations, assign_organizations, import_library_content, export_library_content, import_content, export_content'}

5. Some of the permission changed after the upgrade, a few of them are expected like export_content, import_content but the rest will need to remove.


Actual results:
Some of the permission changed after the upgrade

Expected results:
Need to remove non-required permission from the list.

Additional info:

Comment 1 Brad Buckingham 2021-09-02 14:22:31 UTC
Triaging to 6.10 to get confirmation that the permissions observed after upgrade are correct and expected.

Comment 2 Partha Aji 2021-09-20 20:33:39 UTC
Connecting redmine issue https://projects.theforeman.org/issues/33527 from this bug

Comment 3 Partha Aji 2021-09-20 20:36:03 UTC
Sounds like a fixable legit issue. See https://projects.theforeman.org/issues/33527 for more information

Meanwhile Devendra can ya try running this command after upgrade and confirm those perms get removed :) 
`foreman-rake katello:upgrades:4.1:update_content_import_export_perms`

Comment 4 Brad Buckingham 2021-09-24 12:44:29 UTC
Moving to POST as upstream PR is merged.

Comment 6 Devendra Singh 2021-09-29 09:21:25 UTC
(In reply to Partha Aji from comment #3)
> Sounds like a fixable legit issue. See
> https://projects.theforeman.org/issues/33527 for more information
> 
> Meanwhile Devendra can ya try running this command after upgrade and confirm
> those perms get removed :) 
> `foreman-rake katello:upgrades:4.1:update_content_import_export_perms`


Before "foreman-rake katello:upgrades:4.1:update_content_import_export_perms" ran:

# hammer filter info --id 219
Id:            219
Resource type: Organization
Search:        none
Unlimited?:    yes
Override?:     no
Role:          Manager
Permissions:   view_organizations, create_organizations, edit_organizations, destroy_organizations, assign_organizations, import_library_content, export_library_content, import_content, export_content
Created at:    2018/03/21 11:10:20
Updated at:    2018/03/21 11:10:20

After `foreman-rake katello:upgrades:4.1:update_content_import_export_perms` ran:

# foreman-rake katello:upgrades:4.1:update_content_import_export_perms
'ErbParser' is ignored.
'RubyParser' is ignored.

hammer filter info --id 219
Id:            219
Resource type: Organization
Search:        none
Unlimited?:    yes
Override?:     no
Role:          Manager
Permissions:   view_organizations, create_organizations, edit_organizations, destroy_organizations, assign_organizations, import_content, import_content, export_content, export_content
Created at:    2018/03/21 11:10:20
Updated at:    2018/03/21 11:10:20

It seems the command ` foreman-rake katello:upgrades:4.1:update_content_import_export_perms` creates some duplicate permissions.

Comment 11 Partha Aji 2021-10-11 19:04:04 UTC
Connecting redmine issue https://projects.theforeman.org/issues/33678 from this bug

Comment 13 Brad Buckingham 2021-10-13 19:25:40 UTC
Moving to POST as PR associated with redmine 33678 is now merged.

Comment 15 Devendra Singh 2021-10-19 16:49:41 UTC
Verified on 6.10 snap23

- Upgraded the satellite from 6.9.z to 6.10 snap23.
- Checked the filter permission, didn't see the duplicate entry and non-required permissions.

 hammer filter info --id 219
Id:            219
Resource type: Organization
Search:        none
Unlimited?:    yes
Override?:     no
Role:          Manager
Permissions:   view_organizations, create_organizations, edit_organizations, destroy_organizations, assign_organizations, import_content, export_content
Created at:    2018/03/21 11:10:20
Updated at:    2018/03/21 11:10:20

Comment 18 errata-xmlrpc 2021-11-16 14:13:42 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 (Moderate: Satellite 6.10 Release), 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-2021:4702