use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class PageModelController method deletePageModel.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/{code}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> deletePageModel(@PathVariable String code) throws ApsSystemException {
logger.debug("deleting {}", code);
this.getPageModelService().removePageModel(code);
Map<String, String> result = new HashMap<>();
result.put("code", code);
return new ResponseEntity<>(new RestResponse(result), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class PermissionController method getPermissions.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> getPermissions(RestListRequest requestList) throws JsonProcessingException {
this.getPermissionValidator().validateRestListRequest(requestList);
PagedMetadata<PermissionDto> result = this.getRoleService().getPermissions(requestList);
this.getPermissionValidator().validateRestListResult(requestList, result);
logger.debug("Main Response -> {}", result);
return new ResponseEntity<>(new RestResponse(result.getBody(), null, result), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class RoleController method deleteRole.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/{roleCode}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> deleteRole(@PathVariable String roleCode) throws ApsSystemException {
logger.info("deleting {}", roleCode);
this.getRoleService().removeRole(roleCode);
Map<String, String> result = new HashMap<>();
result.put("code", roleCode);
return new ResponseEntity<>(new RestResponse(result), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class RoleController method getRoles.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> getRoles(RestListRequest requestList) throws JsonProcessingException {
this.getRoleValidator().validateRestListRequest(requestList);
PagedMetadata<RoleDto> result = this.getRoleService().getRoles(requestList);
this.getRoleValidator().validateRestListResult(requestList, result);
logger.debug("loading role list -> {}", result);
return new ResponseEntity<>(new RestResponse(result.getBody(), null, result), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class UserController method deleteUser.
@RestAccessControl(permission = Permission.MANAGE_USERS)
@RequestMapping(value = "/{username}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> deleteUser(@PathVariable String username) throws ApsSystemException {
logger.debug("deleting {}", username);
this.getUserService().removeUser(username);
Map<String, String> result = new HashMap<>();
result.put("code", username);
return new ResponseEntity<>(new RestResponse(result), HttpStatus.OK);
}
Aggregations