use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.
the class AuthorizationRestServiceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
UriBuilder baseUriBuilder = context.getBaseUriBuilder().path(relativeRootResourcePath).path(AuthorizationRestService.PATH);
ResourceOptionsDto resourceOptionsDto = new ResourceOptionsDto();
// GET /
URI baseUri = baseUriBuilder.build();
resourceOptionsDto.addReflexiveLink(baseUri, HttpMethod.GET, "list");
// GET /count
URI countUri = baseUriBuilder.clone().path("/count").build();
resourceOptionsDto.addReflexiveLink(countUri, HttpMethod.GET, "count");
// POST /create
if (isAuthorized(CREATE)) {
URI createUri = baseUriBuilder.clone().path("/create").build();
resourceOptionsDto.addReflexiveLink(createUri, HttpMethod.POST, "create");
}
return resourceOptionsDto;
}
use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.
the class UserResourceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
ResourceOptionsDto dto = new ResourceOptionsDto();
// add links if operations are authorized
UriBuilder baseUriBuilder = context.getBaseUriBuilder().path(rootResourcePath).path(UserRestService.PATH).path(resourceId);
URI baseUri = baseUriBuilder.build();
URI profileUri = baseUriBuilder.path("/profile").build();
dto.addReflexiveLink(profileUri, HttpMethod.GET, "self");
if (!identityService.isReadOnly() && isAuthorized(DELETE)) {
dto.addReflexiveLink(baseUri, HttpMethod.DELETE, "delete");
}
if (!identityService.isReadOnly() && isAuthorized(UPDATE)) {
dto.addReflexiveLink(profileUri, HttpMethod.PUT, "update");
}
return dto;
}
use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.
the class GroupMembersResourceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
ResourceOptionsDto dto = new ResourceOptionsDto();
URI uri = context.getBaseUriBuilder().path(relativeRootResourcePath).path(GroupRestService.PATH).path(resourceId).path(PATH).build();
dto.addReflexiveLink(uri, HttpMethod.GET, "self");
if (!identityService.isReadOnly() && isAuthorized(DELETE)) {
dto.addReflexiveLink(uri, HttpMethod.DELETE, "delete");
}
if (!identityService.isReadOnly() && isAuthorized(CREATE)) {
dto.addReflexiveLink(uri, HttpMethod.PUT, "create");
}
return dto;
}
use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.
the class AuthorizationResourceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
ResourceOptionsDto dto = new ResourceOptionsDto();
URI uri = context.getBaseUriBuilder().path(relativeRootResourcePath).path(AuthorizationRestService.PATH).path(resourceId).build();
dto.addReflexiveLink(uri, HttpMethod.GET, "self");
if (isAuthorized(DELETE)) {
dto.addReflexiveLink(uri, HttpMethod.DELETE, "delete");
}
if (isAuthorized(UPDATE)) {
dto.addReflexiveLink(uri, HttpMethod.PUT, "update");
}
return dto;
}
use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.
the class GroupResourceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
ResourceOptionsDto dto = new ResourceOptionsDto();
// add links if operations are authorized
URI uri = context.getBaseUriBuilder().path(rootResourcePath).path(GroupRestService.PATH).path(resourceId).build();
dto.addReflexiveLink(uri, HttpMethod.GET, "self");
if (!identityService.isReadOnly() && isAuthorized(DELETE)) {
dto.addReflexiveLink(uri, HttpMethod.DELETE, "delete");
}
if (!identityService.isReadOnly() && isAuthorized(UPDATE)) {
dto.addReflexiveLink(uri, HttpMethod.PUT, "update");
}
return dto;
}
Aggregations