HBASE-12043 REST server should respond with FORBIDDEN(403) code on AccessDeniedException (Aditya Kishore)
This commit is contained in:
parent
7b7648322b
commit
e925348979
|
@ -50,8 +50,11 @@ public class ResourceBase implements Constants {
|
|||
//some access denied exceptions are buried
|
||||
while (curr != null) {
|
||||
if(accessDeniedClazz.isAssignableFrom(curr.getClass())) {
|
||||
throw new SecurityException("Unauthorized" + CRLF +
|
||||
StringUtils.stringifyException(exp) + CRLF);
|
||||
throw new WebApplicationException(
|
||||
Response.status(Response.Status.FORBIDDEN)
|
||||
.type(MIMETYPE_TEXT).entity("Forbidden" + CRLF +
|
||||
StringUtils.stringifyException(exp) + CRLF)
|
||||
.build());
|
||||
}
|
||||
curr = curr.getCause();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue