use of com.sequenceiq.authorization.annotation.CheckPermissionByAccount in project cloudbreak by hortonworks.
the class ProxyController method getByResourceCrn.
@Override
@CheckPermissionByAccount(action = AuthorizationResourceAction.POWERUSER_ONLY)
public ProxyResponse getByResourceCrn(@TenantAwareParam String crn) {
String accountId = ThreadBasedUserCrnProvider.getAccountId();
ProxyConfig config = proxyConfigService.getByCrnForAccountId(crn, accountId);
return proxyConfigToProxyResponseConverter.convert(config);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByAccount in project cloudbreak by hortonworks.
the class ProxyController method deleteByName.
@Override
@CheckPermissionByAccount(action = AuthorizationResourceAction.POWERUSER_ONLY)
public ProxyResponse deleteByName(String name) {
ProxyResponse proxyResponse = proxyConfigToProxyResponseConverter.convert(proxyConfigService.deleteByNameInAccount(name, ThreadBasedUserCrnProvider.getAccountId()));
notify(ResourceEvent.PROXY_CONFIG_DELETED);
return proxyResponse;
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByAccount in project cloudbreak by hortonworks.
the class ProxyController method getByEnvironmentCrn.
@Override
@CheckPermissionByAccount(action = AuthorizationResourceAction.POWERUSER_ONLY)
public ProxyResponse getByEnvironmentCrn(@TenantAwareParam String environmentCrn) {
String accountId = ThreadBasedUserCrnProvider.getAccountId();
ProxyConfig proxyConfig = proxyConfigService.getByEnvironmentCrnAndAccountId(environmentCrn, accountId);
return proxyConfigToProxyResponseConverter.convert(proxyConfig);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByAccount in project cloudbreak by hortonworks.
the class ProxyController method deleteByCrn.
@Override
@CheckPermissionByAccount(action = AuthorizationResourceAction.POWERUSER_ONLY)
public ProxyResponse deleteByCrn(String crn) {
ProxyResponse proxyResponse = proxyConfigToProxyResponseConverter.convert(proxyConfigService.deleteByCrnInAccount(crn, ThreadBasedUserCrnProvider.getAccountId()));
notify(ResourceEvent.PROXY_CONFIG_DELETED);
return proxyResponse;
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByAccount in project cloudbreak by hortonworks.
the class SdxController method create.
@Override
@CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_DATALAKE)
public SdxClusterResponse create(@ValidStackNameFormat @ValidStackNameLength String name, @Valid SdxClusterRequest createSdxClusterRequest) {
String userCrn = ThreadBasedUserCrnProvider.getUserCrn();
Pair<SdxCluster, FlowIdentifier> result = sdxService.createSdx(userCrn, name, createSdxClusterRequest, null);
SdxCluster sdxCluster = result.getLeft();
metricService.incrementMetricCounter(MetricType.EXTERNAL_SDX_REQUESTED, sdxCluster);
SdxClusterResponse sdxClusterResponse = sdxClusterConverter.sdxClusterToResponse(sdxCluster);
sdxClusterResponse.setName(sdxCluster.getClusterName());
sdxClusterResponse.setFlowIdentifier(result.getRight());
return sdxClusterResponse;
}
Aggregations