package com.sequenceiq.freeipa.repository;

import java.util.Optional;

import javax.transaction.Transactional;

import org.springframework.data.repository.CrudRepository;

import com.sequenceiq.freeipa.entity.Stack;
import com.sequenceiq.freeipa.entity.UserSyncStatus;

@Transactional(Transactional.TxType.REQUIRED)
public interface UserSyncStatusRepository extends CrudRepository<UserSyncStatus, Long> {

    Optional<UserSyncStatus> getByStack(Stack stack);
}

package com.sequenceiq.freeipa.repository;

import java.util.Optional;

import javax.transaction.Transactional;

import org.springframework.data.repository.CrudRepository;

import com.sequenceiq.freeipa.entity.Stack;
import com.sequenceiq.freeipa.entity.UserSyncStatus;

@Transactional(Transactional.TxType.REQUIRED)
public interface UserSyncStatusRepository extends CrudRepository<UserSyncStatus, Long> {

    Optional<UserSyncStatus> getByStack(Stack stack);

    @Override
    @CheckPermission(action = ResourceAction.READ)
    <S extends UserSyncStatus> S save(S entity);
}

Revert "Revert "CDPCP-1549. Reconcile usersyncstatus permissions with operation permissions""