Bug #33678
Import/Export Permission Upgrade task not deleting duplicate entries
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
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
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
- 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
History
#1
Updated by The Foreman Bot over 1 year 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 over 1 year ago
- Bugzilla link set to 2000063
#3
Updated by Jonathon Turel over 1 year ago
- Target version set to Katello 4.2.1
#4
Updated by Andrew Dewar over 1 year ago
- Triaged changed from No to Yes
#5
Updated by The Foreman Bot over 1 year ago
- Fixed in Releases Katello 4.3.0 added
#6
Updated by Partha Aji over 1 year ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|b9b2a4f6b874b75f5c1f536655e2ce1986421f51.
Fixes #33678 - Fixes import/export permissions on an upgrade task (#9717)