use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.
the class TenantResourceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
ResourceOptionsDto dto = new ResourceOptionsDto();
// add links if operations are authorized
URI uri = context.getBaseUriBuilder().path(rootResourcePath).path(TenantRestService.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;
}
use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.
the class FilterResourceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
ResourceOptionsDto dto = new ResourceOptionsDto();
UriBuilder baseUriBuilder = context.getBaseUriBuilder().path(relativeRootResourcePath).path(FilterRestService.PATH).path(resourceId);
URI baseUri = baseUriBuilder.build();
if (isAuthorized(READ)) {
dto.addReflexiveLink(baseUri, HttpMethod.GET, "self");
URI singleResultUri = baseUriBuilder.clone().path("/singleResult").build();
dto.addReflexiveLink(singleResultUri, HttpMethod.GET, "singleResult");
dto.addReflexiveLink(singleResultUri, HttpMethod.POST, "singleResult");
URI listUri = baseUriBuilder.clone().path("/list").build();
dto.addReflexiveLink(listUri, HttpMethod.GET, "list");
dto.addReflexiveLink(listUri, HttpMethod.POST, "list");
URI countUri = baseUriBuilder.clone().path("/count").build();
dto.addReflexiveLink(countUri, HttpMethod.GET, "count");
dto.addReflexiveLink(countUri, HttpMethod.POST, "count");
}
if (isAuthorized(DELETE)) {
dto.addReflexiveLink(baseUri, HttpMethod.DELETE, "delete");
}
if (isAuthorized(UPDATE)) {
dto.addReflexiveLink(baseUri, HttpMethod.PUT, "update");
}
return dto;
}
use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.
the class TenantGroupMembersResourceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
ResourceOptionsDto dto = new ResourceOptionsDto();
URI uri = context.getBaseUriBuilder().path(relativeRootResourcePath).path(TenantRestService.PATH).path(resourceId).path(TenantGroupMembersResource.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 TenantUserMembersResourceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
ResourceOptionsDto dto = new ResourceOptionsDto();
URI uri = context.getBaseUriBuilder().path(relativeRootResourcePath).path(TenantRestService.PATH).path(resourceId).path(TenantUserMembersResource.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 TenantRestServiceImpl method availableOperations.
public ResourceOptionsDto availableOperations(UriInfo context) {
UriBuilder baseUriBuilder = context.getBaseUriBuilder().path(relativeRootResourcePath).path(TenantRestService.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 (!getIdentityService().isReadOnly() && isAuthorized(CREATE)) {
URI createUri = baseUriBuilder.clone().path("/create").build();
resourceOptionsDto.addReflexiveLink(createUri, HttpMethod.POST, "create");
}
return resourceOptionsDto;
}
Aggregations