Description of problem:
Accessing new host index page without view hosts permission displays the page with a 403 error. The previous implementation showed an error page that mentioned which permission the user is currently lacking.
How reproducible:
Always
Is this issue a regression from an earlier version:
It's a regression between the old and the new implementation
Steps to Reproduce:
1. Have a user without any permissions
2. Log in as that user
3. Navigate to /new/hosts
4. Open the browser console and see never ending flow of errors like:
GET https://<FQDN>/katello/api/v2/organizations/1 Status 403 15:04:06.507 XHR GET https://<FQDN>/katello/api/v2/organizations/1 [HTTP/2 403 147ms] error { message: "Access denied", details: "Missing one of the required permissions: view_organizations", missing_permissions: (1)[…] } message "Access denied" details "Missing one of the required permissions: view_organizations" missing_permissions [ "view_organizations" ] 0 "view_organizations"
Actual behavior:
Javascript calls and failures never end, the page doesn't understand that 403 is an answer enough.
Page loads with search bar, register and create buttons. The table body contains text "Request failed with status code 403"
Expected behavior:
Javascript should terminate after 403 and a correct message should be displayed as per related bug SAT-38091.
An error page stating the user doesn't have view_hosts permission
Business Impact / Additional info:
See attachments for difference between the old and the new page.