Project

General

Profile

Bug #33678

Import/Export Permission Upgrade task not deleting duplicate entries

Added by Partha Aji 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

https://github.com/Katello/katello/pull/9354 as a part of issue https://projects.theforeman.org/issues/32396 renamed export_library_content and export_content_views permission to export_content.

As a part of that PR is this command.
bundle exec rake katello:upgrades:4.1:update_content_import_export_perms

This command renames export_library_content to export_content correctly but keeps the old export_content permission also intact in the filter causing duplicate values in the filter.
To reproduce either
  • In a 3.18 machine, create a role that has the following filters on resource `organization` => `import_library_content, export_library_content, import_content, export_content`
  • Upgrade to the latest
  • Do a `hammer filter list` and look at the permissions of the last row
    Expected
    import_content, export_content

Actual:
import_content, import_content, export_content, export_content

Alternatively you can reproduce this in the development environment via the rake console
  • Add the following permissions
    ```
    [11] pry(main)> Permission.create(name: :import_library_content, resource_type: 'Organization')
    => #<Permission:0x0000000013477af8 id: 227, name: "import_library_content", resource_type: "Organization", created_at: Mon, 11 Oct 2021 18:13:42 UTC +00:00, updated_at: Mon, 11 Oct 2021 18:13:42 UTC +00:00>
    [12] pry(main)> Permission.create(name: :export_library_content, resource_type: 'Organization')
    => #<Permission:0x0000000018edbe18 id: 228, name: "export_library_content", resource_type: "Organization", created_at: Mon, 11 Oct 2021 18:13:51 UTC +00:00, updated_at: Mon, 11 Oct 2021 18:13:51 UTC +00:00>
    ```
  • Create a role with permissions on resource `organization` => `import_library_content, export_library_content, import_content, export_content`
  • `bundle exec rake katello:upgrades:4.1:update_content_import_export_perms`
  • Do a `hammer filter list` and look at the permissions of the last row
    Expected
    import_content, export_content

Actual:
import_content, import_content, export_content, export_content

Associated revisions

Revision b9b2a4f6 (diff)
Added by Partha Aji 7 months ago

Fixes #33678 - Fixes import/export permissions on an upgrade task (#9717)

  • Fixes #33678 - Fixes import/export permissions on an upgrade task

History

#1 Updated by The Foreman Bot 7 months ago

  • Assignee set to Partha Aji
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/9717 added

#2 Updated by Partha Aji 7 months ago

  • Bugzilla link set to 2000063

#3 Updated by Jonathon Turel 7 months ago

  • Target version set to Katello 4.2.1

#4 Updated by Andrew Dewar 7 months ago

  • Triaged changed from No to Yes

#5 Updated by The Foreman Bot 7 months ago

  • Fixed in Releases Katello 4.3.0 added

#6 Updated by Partha Aji 7 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF