Add purge action.

This commit is contained in:
Paulo Gustavo Veiga 2013-03-24 15:03:19 -03:00
parent 811cc8a668
commit 0b6c8a5977
2 changed files with 2 additions and 1 deletions

View File

@ -131,7 +131,7 @@ public class AdminController extends BaseController {
userService.deleteUser(user); userService.deleteUser(user);
} }
@RequestMapping(method = RequestMethod.GET, value = "admin/db/purge", consumes = {"text/plain"}) @RequestMapping(method = RequestMethod.GET, value = "admin/database/purge")
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void purgeDB(@RequestParam(required = true) int max) throws UnsupportedEncodingException, WiseMappingException { public void purgeDB(@RequestParam(required = true) int max) throws UnsupportedEncodingException, WiseMappingException {

View File

@ -43,6 +43,7 @@
<sec:http use-expressions="true" access-denied-page="/c/login"> <sec:http use-expressions="true" access-denied-page="/c/login">
<sec:intercept-url pattern="/c/restful/admin/users/**" access="isAuthenticated() and hasRole('ROLE_ADMIN')"/> <sec:intercept-url pattern="/c/restful/admin/users/**" access="isAuthenticated() and hasRole('ROLE_ADMIN')"/>
<sec:intercept-url pattern="/c/restful/admin/database/**" access="isAuthenticated() and hasRole('ROLE_ADMIN')"/>
<sec:intercept-url pattern="/c/**/*" access="isAuthenticated() and hasRole('ROLE_USER')"/> <sec:intercept-url pattern="/c/**/*" access="isAuthenticated() and hasRole('ROLE_USER')"/>
<sec:form-login login-page="/c/login" <sec:form-login login-page="/c/login"