use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getSecurityGroups.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public PlatformSecurityGroupsResponse getSecurityGroups(@ResourceCrn String environmentCrn, String region, String platformVariant, String availabilityZone, String sharedProjectId) {
String accountId = getAccountId();
validateEnvironmentCrnPattern(environmentCrn);
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequestByEnvironment(accountId, environmentCrn, region, platformVariant, availabilityZone, sharedProjectId);
LOGGER.info("Get /platform_resources/security_groups, request: {}", request);
CloudSecurityGroups securityGroups = platformParameterService.getSecurityGroups(request);
PlatformSecurityGroupsResponse response = cloudSecurityGroupsToPlatformSecurityGroupsV1ResponseConverter.convert(securityGroups);
LOGGER.info("Resp /platform_resources/security_groups, request: {}, securityGroups: {}, response: {}", request, securityGroups, response);
return response;
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn in project cloudbreak by hortonworks.
the class DistroXV1Controller method putScalingByCrn.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.SCALE_DATAHUB)
public void putScalingByCrn(@ValidCrn(resource = CrnResourceDescriptor.DATAHUB) @TenantAwareParam @ResourceCrn String crn, @Valid DistroXScaleV1Request updateRequest) {
StackScaleV4Request stackScaleV4Request = scaleRequestConverter.convert(updateRequest);
stackScaleV4Request.setStackId(stackOperations.getStackByCrn(crn).getId());
stackOperations.putScaling(NameOrCrn.ofCrn(crn), getWorkspaceIdForCurrentUser(), stackScaleV4Request);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn in project cloudbreak by hortonworks.
the class SdxController method getDetailByCrn.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_DETAILED_DATALAKE)
public SdxClusterDetailResponse getDetailByCrn(@TenantAwareParam @ResourceCrn String clusterCrn, Set<String> entries) {
SdxCluster sdxCluster = getSdxClusterByCrn(clusterCrn);
StackV4Response stackV4Response = sdxService.getDetail(sdxCluster.getClusterName(), entries, sdxCluster.getAccountId());
SdxClusterResponse sdxClusterResponse = sdxClusterConverter.sdxClusterToResponse(sdxCluster);
return SdxClusterDetailResponse.create(sdxClusterResponse, stackV4Response);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn in project cloudbreak by hortonworks.
the class SdxController method renewCertificate.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.REPAIR_DATALAKE)
public FlowIdentifier renewCertificate(@ResourceCrn @TenantAwareParam String crn) {
String userCrn = ThreadBasedUserCrnProvider.getUserCrn();
SdxCluster sdxCluster = sdxService.getByCrn(userCrn, crn);
return certRenewalService.triggerRenewCertificate(sdxCluster, userCrn);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn in project cloudbreak by hortonworks.
the class ImageCatalogV4Controller method deleteByCrn.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_IMAGE_CATALOG)
public ImageCatalogV4Response deleteByCrn(Long workspaceId, @ResourceCrn String crn) {
ImageCatalog deleted = imageCatalogService.delete(NameOrCrn.ofCrn(crn), restRequestThreadLocalService.getRequestedWorkspaceId());
notify(ResourceEvent.IMAGE_CATALOG_DELETED);
return imageCatalogToImageCatalogV4ResponseConverter.convert(deleted);
}
Aggregations