Search in sources :

Example 1 with AuthorizeForAutoscaleV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.autoscales.response.AuthorizeForAutoscaleV4Response in project cloudbreak by hortonworks.

the class AutoscaleV4Controller method authorizeForAutoscale.

@Override
@InternalOnly
public AuthorizeForAutoscaleV4Response authorizeForAutoscale(@TenantAwareParam String crn, String userId, String tenant, String permission) {
    AuthorizeForAutoscaleV4Response response = new AuthorizeForAutoscaleV4Response();
    try {
        restRequestThreadLocalService.setCloudbreakUserByUsernameAndTenant(userId, tenant);
        // TODO check permission explicitly
        Stack stack = stackService.getByCrn(crn);
        response.setSuccess(true);
    } catch (RuntimeException ignore) {
        response.setSuccess(false);
    }
    return response;
}
Also used : AuthorizeForAutoscaleV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.autoscales.response.AuthorizeForAutoscaleV4Response) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) InternalOnly(com.sequenceiq.authorization.annotation.InternalOnly)

Aggregations

InternalOnly (com.sequenceiq.authorization.annotation.InternalOnly)1 AuthorizeForAutoscaleV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.autoscales.response.AuthorizeForAutoscaleV4Response)1 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)1