#3993 API: Rephrase the error message when denying an API key with insufficient permissions
Closed: Invalid by rayson. Opened by rayson.

When calling an API with a key that doesn't have sufficient permissions, the error message should be something like Permission denied. Please create a new API key with correct ACLs. not misleading Invalid or expired token. Please visit https://pagure.io/settings#api-keys to get or renew your API token..

Actual result:

# curl -H 'Authorization: token <some-valid-token>' -X POST https://pagure.io/api/0/fork/rayson/waiverdb/pull-request/9/comment
{
  "error": "Invalid or expired token. Please visit https://pagure.io/settings#api-keys to get or renew your API token.",
  "error_code": "EINVALIDTOK"
}

Well, it was an ACL problem.
However, I expect the error code and message should be something like insufficient permission, not Invalid or expired token. The error message is misleading.

Metadata Update from @rayson:
- Issue close_status updated to: Invalid
- Issue status updated to: Closed (was: Open)

Metadata