Actions
Bug #20120
closedPoor logging of 403 - forbidden responses
Status:
Closed
Priority:
Normal
Assignee:
Category:
Hammer core
Target version:
Difficulty:
Triaged:
Team Backlog:
Description
When user has insufficient permissions for some action and the foreman replies 403, hammer prints quite a poor message without telling the user what permissions are required (even though server provides such info).
# With user without "View hosts" permissions: > hammer -u test host list Forbidden - server refused to process the request
The response from the server:
[ERROR 2017-06-27T11:15:48 API] 403 Forbidden [DEBUG 2017-06-27T11:15:48 API] { "error" => { "message" => "Access denied", "details" => "Missing one of the required permissions: view_hosts" } } [DEBUG 2017-06-27T11:15:48 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_forbidden [ERROR 2017-06-27T11:15:48 Exception] Forbidden - server refused to process the request
Expected results:
> hammer -u test host list Access denied Missing one of the required permissions: view_hosts
Actions