use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class GroupController method deleteGroup.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/{groupName}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> deleteGroup(@PathVariable String groupName) throws ApsSystemException {
logger.info("deleting {}", groupName);
this.getGroupService().removeGroup(groupName);
Map<String, String> result = new HashMap<>();
result.put("code", groupName);
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 LabelController method deleteLabelGroup.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/{labelCode}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> deleteLabelGroup(@PathVariable String labelCode) throws ApsSystemException {
logger.debug("deleting label {}", labelCode);
this.getLabelService().removeLabelGroup(labelCode);
Map<String, String> result = new HashMap<>();
result.put("key", labelCode);
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 LabelController method getLables.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> getLables(RestListRequest requestList) {
logger.debug("loading labels");
this.getLabelValidator().validateRestListRequest(requestList);
PagedMetadata<LabelDto> result = this.getLabelService().getLabelGroups(requestList);
this.getLabelValidator().validateRestListResult(requestList, 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 LanguageController method getLanguages.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> getLanguages(RestListRequest requestList) {
logger.trace("loading languages list");
this.getLanguageValidator().validateRestListRequest(requestList);
PagedMetadata<LanguageDto> result = this.getLanguageService().getLanguages(requestList);
this.getLanguageValidator().validateRestListResult(requestList, 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 PageConfigurationController method updatePageWidget.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/pages/{pageCode}/widgets/{frameId}", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> updatePageWidget(@PathVariable String pageCode, @PathVariable int frameId, @Valid @RequestBody WidgetConfigurationRequest widget, BindingResult bindingResult) {
logger.trace("updating widget configuration in page {} and frame {}", pageCode, frameId);
WidgetConfigurationDto widgetConfiguration = this.getPageService().updateWidgetConfiguration(pageCode, frameId, widget);
Map<String, String> metadata = new HashMap<>();
metadata.put("status", IPageService.STATUS_DRAFT);
return new ResponseEntity<>(new RestResponse(widgetConfiguration, null, metadata), HttpStatus.OK);
}
Aggregations