Standardize responses in REST apis when user is not authorized.
WebResource takes care of portlet validation, but also authorization at API level should transform to 403 (Forbidden) when responding. We sometimes respond with 500, which is not ok.
See the following ones for some examples of this:
Error codes: Code 401 (Unauthorized): When a user has not logged in and attempts to access a restricted REST service Code 403 (Forbidden): When the user has logged in, and attempts to access a restricted REST service that has no permission Code 200 (Ok): When the user has logged in, and attempts to access a restricted REST service that has permission , and everything works fine Code 500 (Internal Server Error): When the user has logged in, and attempts to access a restricted REST service that has permission, but there's an error processing the request
Passed QA
Documented: https://auth.dotcms.com/docs/latest/error-messaging-rest-api