Bug #31836
closedUnclear / incomplete error message while trying to promote a content view with a user that has insufficient permissions
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1722799
Description of problem:
A user called "updater" with assigned Role called "updater" has the following permissions:
Lifecycle Environments => edit_lifecycle_environments
"content views" => view_content_views, edit_content_views, promote_or_remove_content_views
Using this user to promote a content-view results in the following error:
Could not promote the content view:
Access denied
Missing one of the required permissions: promote_or_remove_content_views
As you can see the error message states "Missing one of the..." which is plural, but only lists ONE missing permission.
In addition, this permission is already given to the user in question. What's really missing is the following permission:
Lifecycle Environments => promote_or_remove_content_views_to_environment
But the error message does not state this. I think extending
the error message to list all required permissions may be the better approach.
Version-Release number of selected component (if applicable):
Katello 3.7 & Katello 3.10 were tested.
How reproducible:
Steps to Reproduce:
- create user "updater"
- grant viewer role
- create new role "updater"
- apply filters to role "updater":
-- "Lifecycle Environments" => edit_lifecycle_environments
-- "content views" => view_content_views, edit_content_views, promote_or_remove_content_views
Try to promote a content view with that user to get the error:
[root@foreman ~]# hammer -u updater content-view version promote --content-view-id <ID> --to-lifecycle-environment-id <ID> --id <ID> --organization-id <ID>
[Foreman] Password for updater:
Could not promote the content view:
Access denied
Missing one of the required permissions: promote_or_remove_content_views
Actual results:
Could not promote the content view:
Access denied
Missing one of the required permissions: promote_or_remove_content_views
Expected results:
Could not promote the content view:
Access denied
Missing one of the required permissions: promote_or_remove_content_views, view_content_views, edit_content_views, promote_or_remove_content_views_to_environment
Additional info:
Updated by Ian Ballou almost 4 years ago
- Subject changed from Unclear / incomplete error message while trying to promote a content view with a user that has insufficient permissions to Unclear / incomplete error message while trying to promote a content view with a user that has insufficient permissions
Updated by Ian Ballou almost 4 years ago
The problem is a little bit different now on the latest dev branch:
[vagrant@centos7-hammer-devel-2 ~]$ hammer -u Updater -p changeme content-view version promote --content-view-id 2 --organization-id 1 --to-lifecycle-environment-id 1 Warning: An error occured while loading module hammer_cli_foreman_remote_execution. Could not promote the content view: Missing arguments for '--id'. [vagrant@centos7-hammer-devel-2 ~]$ hammer -u Updater -p changeme content-view version promote --id 2 --organization-id 1 --to-lifecycle-environment-id 1 Warning: An error occured while loading module hammer_cli_foreman_remote_execution. Could not promote the content view: Could not find content_view_version resource with id 2
Edit: Need to verify this since it might just be my development environment. When briefly switching the code back to 2.3/3.18, I saw the same error.
Edit edit: Confirmed on 6-day-old nightly stable.
Updated by Ian Ballou almost 4 years ago
The error looks just like the one in the description for Katello 3.16. I'm also seeing
Could not find content_view_version resource with id 2
in Katello 3.17 and 3.18, however.
Updated by The Foreman Bot almost 4 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ian Ballou
- Pull request https://github.com/Katello/katello/pull/9153 added
Updated by Ian Ballou almost 4 years ago
- Target version changed from Katello 3.18.2 to Katello 3.17.3
- Triaged changed from No to Yes
Updated by The Foreman Bot almost 4 years ago
- Fixed in Releases Katello 4.1.0 added
Updated by Anonymous almost 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|1bba15fd35151400fb74cfc79315f84cff61f948.