use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceName in project cloudbreak by hortonworks.
the class EnvironmentController method updateAwsDiskEncryptionParametersByEnvironmentName.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.UPDATE_AWS_DISK_ENCRYPTION_PARAMETERS)
public DetailedEnvironmentResponse updateAwsDiskEncryptionParametersByEnvironmentName(@ResourceName String environmentName, @RequestObject @Valid UpdateAwsDiskEncryptionParametersRequest request) {
String accountId = ThreadBasedUserCrnProvider.getAccountId();
UpdateAwsDiskEncryptionParametersDto dto = environmentApiConverter.convertUpdateAwsDiskEncryptionParametersDto(request);
EnvironmentDto result = environmentModificationService.updateAwsDiskEncryptionParametersByEnvironmentName(accountId, environmentName, dto);
return environmentResponseConverter.dtoToDetailedResponse(result);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceName in project cloudbreak by hortonworks.
the class ImageCatalogV4Controller method deleteByName.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_IMAGE_CATALOG)
public ImageCatalogV4Response deleteByName(Long workspaceId, @ResourceName String name) {
ImageCatalog deleted = imageCatalogService.delete(NameOrCrn.ofName(name), restRequestThreadLocalService.getRequestedWorkspaceId());
notify(ResourceEvent.IMAGE_CATALOG_DELETED);
return imageCatalogToImageCatalogV4ResponseConverter.convert(deleted);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceName in project cloudbreak by hortonworks.
the class ImageCatalogV4Controller method getByName.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_IMAGE_CATALOG)
public ImageCatalogV4Response getByName(Long workspaceId, @ResourceName String name, Boolean withImages) {
ImageCatalog catalog = imageCatalogService.getImageCatalogByName(NameOrCrn.ofName(name), restRequestThreadLocalService.getRequestedWorkspaceId());
ImageCatalogV4Response imageCatalogResponse = imageCatalogToImageCatalogV4ResponseConverter.convert(catalog);
Images images = imageCatalogService.propagateImagesIfRequested(restRequestThreadLocalService.getRequestedWorkspaceId(), name, withImages);
if (images != null) {
imageCatalogResponse.setImages(imagesToImagesV4ResponseConverter.convert(images));
}
return imageCatalogResponse;
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceName in project cloudbreak by hortonworks.
the class BlueprintV4Controller method getParameters.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_CLUSTER_TEMPLATE)
public ParametersQueryV4Response getParameters(Long workspaceId, @ResourceName String name) {
ParametersQueryV4Response parametersQueryV4Response = new ParametersQueryV4Response();
parametersQueryV4Response.setCustom(blueprintService.queryCustomParametersMap(name, restRequestThreadLocalService.getRequestedWorkspaceId()));
return parametersQueryV4Response;
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceName in project cloudbreak by hortonworks.
the class CustomImageCatalogV4Controller method getCustomImage.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_IMAGE_CATALOG)
public CustomImageCatalogV4GetImageResponse getCustomImage(@ResourceName String name, String imageId, @AccountId String accountId) {
CustomImage customImage = customImageCatalogService.getCustomImage(restRequestThreadLocalService.getRequestedWorkspaceId(), name, imageId);
Image sourceImage = customImageCatalogService.getSourceImage(customImage);
CustomImageCatalogV4GetImageResponse response = customImageToCustomImageCatalogV4GetImageResponseConverter.convert(customImage);
response.setSourceImageDate(sourceImage.getCreated());
return response;
}
Aggregations