Search in sources :

Example 1 with AccountIdNotNeeded

use of com.sequenceiq.authorization.annotation.AccountIdNotNeeded in project cloudbreak by hortonworks.

the class UserV1Controller method synchronizeAllUsers.

@Override
@AccountIdNotNeeded
@CustomPermissionCheck
public SyncOperationStatus synchronizeAllUsers(SynchronizeAllUsersRequest request) {
    String userCrn = checkActorCrn();
    String accountId = determineAccountId(userCrn, request.getAccountId());
    LOGGER.debug("synchronizeAllUsers() requested for account {}", accountId);
    UserSyncRequestFilter userSyncFilter = new UserSyncRequestFilter(nullToEmpty(request.getUsers()), nullToEmpty(request.getMachineUsers()), getOptionalDeletedWorkloadUser(request.getDeletedWorkloadUsers()));
    Operation syncOperation = userSyncService.synchronizeUsersWithCustomPermissionCheck(accountId, userCrn, nullToEmpty(request.getEnvironments()), userSyncFilter, request.getWorkloadCredentialsUpdateType(), AuthorizationResourceAction.DESCRIBE_ENVIRONMENT);
    return checkOperationRejected(operationToSyncOperationStatus.convert(syncOperation));
}
Also used : UserSyncRequestFilter(com.sequenceiq.freeipa.service.freeipa.user.UserSyncRequestFilter) Operation(com.sequenceiq.freeipa.entity.Operation) CustomPermissionCheck(com.sequenceiq.authorization.annotation.CustomPermissionCheck) AccountIdNotNeeded(com.sequenceiq.authorization.annotation.AccountIdNotNeeded)

Aggregations

AccountIdNotNeeded (com.sequenceiq.authorization.annotation.AccountIdNotNeeded)1 CustomPermissionCheck (com.sequenceiq.authorization.annotation.CustomPermissionCheck)1 Operation (com.sequenceiq.freeipa.entity.Operation)1 UserSyncRequestFilter (com.sequenceiq.freeipa.service.freeipa.user.UserSyncRequestFilter)1