Commit 2acf8143 authored by Matija Obreza's avatar Matija Obreza
Browse files

403 Access Denied handler

parent 879eadf5
......@@ -54,7 +54,6 @@ public class TeamServiceImpl implements TeamService {
@PostAuthorize("hasRole('ADMINISTRATOR') or hasPermission(returnObject, 'READ')")
public Team getTeam(String uuid) {
Team team = teamRepository.findOneByUuid(uuid);
System.err.println("Loaded by uuid: " + team);
return team;
}
......
......@@ -65,9 +65,10 @@ public class UserControllerAdvice extends BaseController {
@ResponseStatus(HttpStatus.FORBIDDEN)
@ExceptionHandler(value = {AccessDeniedException.class})
@ResponseBody
// @ResponseBody
public String handleAccessDeniedException(AccessDeniedException e){
return simpleExceptionHandler(e);
// return simpleExceptionHandler(e);
return "/errors/access-denied";
}
@ResponseStatus(HttpStatus.UNAUTHORIZED)
......
......@@ -14,6 +14,10 @@
# limitations under the License.
#-------------------------------------------------------------------------------
# Errors
error.access-denied=403 Access denied
error.access-denied.text=You do not have permission to access the resource.
# Login
login.username=Username
login.password=Password
......
<!DOCTYPE html>
<%@include file="/WEB-INF/jsp/init.jsp"%>
<html>
<head>
<title><spring:message code="error.access-denied" /></title>
<style>
body {
background-color: #E8E5E0;
color: #333333;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
line-height: 1.42857;
}
</style>
</head>
<body>
<h1>
<spring:message code="error.access-denied" />
</h1>
<p>
<spring:message code="error.access-denied.text" />
</p>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sitemesh>
<mime-type>text/html</mime-type>
<mapping path="/welcome" decorator="/WEB-INF/decorator/entry.jsp" />
<mapping path="/*" decorator="/WEB-INF/decorator/main.jsp" />
<mapping path="/html/*" exclude="true" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment