Actions
Bug #33678
closedImport/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
Actions