use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceName in project cloudbreak by hortonworks.
the class CredentialV1Controller method getByEnvironmentName.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_CREDENTIAL_ON_ENVIRONMENT)
public CredentialResponse getByEnvironmentName(@ResourceName String environmentName) {
String accountId = ThreadBasedUserCrnProvider.getAccountId();
Credential credential = credentialService.getByEnvironmentNameAndAccountId(environmentName, accountId, ENVIRONMENT);
return credentialConverter.convert(credential);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceName in project cloudbreak by hortonworks.
the class EnvironmentController method deleteByName.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_ENVIRONMENT)
public SimpleEnvironmentResponse deleteByName(@ResourceName String environmentName, boolean cascading, boolean forced) {
String accountId = ThreadBasedUserCrnProvider.getAccountId();
String actualUserCrn = ThreadBasedUserCrnProvider.getUserCrn();
EnvironmentViewDto environmentDto = environmentDeletionService.deleteByNameAndAccountId(environmentName, accountId, actualUserCrn, cascading, forced);
return environmentResponseConverter.dtoToSimpleResponse(environmentDto);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceName in project cloudbreak by hortonworks.
the class EnvironmentController method changeTelemetryFeaturesByEnvironmentName.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.EDIT_ENVIRONMENT)
public DetailedEnvironmentResponse changeTelemetryFeaturesByEnvironmentName(@ResourceName String name, @Valid FeaturesRequest request) {
String accountId = ThreadBasedUserCrnProvider.getAccountId();
EnvironmentFeatures features = environmentApiConverter.convertToEnvironmentTelemetryFeatures(request);
EnvironmentDto result = environmentModificationService.changeTelemetryFeaturesByEnvironmentName(accountId, name, features);
return environmentResponseConverter.dtoToDetailedResponse(result);
}
use of com.sequenceiq.authorization.annotation.CheckPermissionByResourceName in project cloudbreak by hortonworks.
the class EnvironmentController method updateEnvironmentLoadBalancersByName.
@Override
@CheckPermissionByResourceName(action = AuthorizationResourceAction.EDIT_ENVIRONMENT)
public FlowIdentifier updateEnvironmentLoadBalancersByName(@ResourceName String envName, @NotNull EnvironmentLoadBalancerUpdateRequest request) {
String accountId = ThreadBasedUserCrnProvider.getAccountId();
EnvironmentDto environmentDto = environmentService.getByNameAndAccountId(envName, accountId);
EnvironmentLoadBalancerDto environmentLoadBalancerDto = environmentApiConverter.initLoadBalancerDto(request);
return environmentLoadBalancerService.updateLoadBalancerInEnvironmentAndStacks(environmentDto, environmentLoadBalancerDto);
}
Aggregations