Class ClientRoleUtil

java.lang.Object
com.skava.auth.util.ClientRoleUtil

public final class ClientRoleUtil extends Object
  • Method Details

    • addClientIdsPredicate

      public static jakarta.persistence.criteria.Predicate addClientIdsPredicate(jakarta.persistence.criteria.Predicate clientRoleSearchPredicate, List<String> resultClientIds, jakarta.persistence.criteria.Root<ClientRole> root, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder)
      Parameters:
      clientRoleSearchPredicate - a Predicate object.
      resultClientIds - a List of Long object.
      root - a Root object.
      criteriaBuilder - a CriteriaBuilder object.
      Returns:
      a Predicate object.
    • getDistinctClientIds

      public static List<jakarta.persistence.Tuple> getDistinctClientIds(int page, int size, jakarta.persistence.criteria.CriteriaQuery<jakarta.persistence.Tuple> selectDistinctClientQuery, jakarta.persistence.criteria.Root<ClientRole> root, jakarta.persistence.criteria.Predicate clientRoleSearchPredicate, jakarta.persistence.EntityManager entityManager)
      Parameters:
      page - a Integer object.
      size - a Integer object.
      selectDistinctClientQuery - a CriteriaQuery object.
      root - a Root object.
      clientRoleSearchPredicate - a Predicate object.
      entityManager - a EntityManager object.
      Returns:
      a List of Tuple objects.
    • preAuthorizeForClientRoleSearch

      public static void preAuthorizeForClientRoleSearch(boolean isSuperAdmin, boolean hasCollectionAccess, boolean hasSelfAccess, boolean hasBusinessAccess, org.springframework.context.MessageSource messageSource)
      Parameters:
      isSuperAdmin - a Boolean object.
      hasCollectionAccess - a Boolean object.
      hasSelfAccess - a Boolean object.
      hasBusinessAccess - a Boolean object.
      messageSource - a MessageSource object.
    • validateClientCount

      public static boolean validateClientCount(int clientCount, org.springframework.context.MessageSource messageSource)
      Parameters:
      clientCount - a Integer object.
      messageSource - a MessageSource object.
      Returns:
      a Boolean object.
    • getClientRoleSearchPredicate

      public static jakarta.persistence.criteria.Predicate getClientRoleSearchPredicate(Long collectionId, List<SearchCriteria> params, jakarta.persistence.criteria.Root<ClientRole> root, jakarta.persistence.criteria.CriteriaBuilder builder)
      This method is used to search auth group.
      Parameters:
      collectionId - a Long object.
      params - The list of search criteria.
      root - a Root of ClientRole object.
      builder - a CriteriaBuilder object.
      Returns:
      The list of client role.
    • searchClientsRoles

      public static ClientsRolesResponse searchClientsRoles(Long collectionId, int page, int size, List<SearchCriteria> params, jakarta.persistence.EntityManager entityManager, ClientRoleRepository clientRoleRepository)
    • searchClientRolesByClientId

      public static List<ClientRole> searchClientRolesByClientId(String sort, org.springframework.data.jpa.domain.Specification<ClientRole> clientRoleSpecification, ClientRoleRepository clientRoleRepository, org.springframework.context.MessageSource messageSource)
    • searchClientRoles

      public static ClientsRolesResponse searchClientRoles(Long collectionId, Boolean skipPagination, ClientsRoleRequest input, List<SearchCriteria> params, AuthCommonServices authCommonServices, jakarta.persistence.EntityManager entityManager)
      This method is used to search collection.
      Parameters:
      collectionId - a Long object.
      input - a ClientsRoleRequest object.
      params - a list of SearchCriteria object.
      skipPagination - a Boolean object.
      authCommonServices - a AuthCommonServices object.
      entityManager - a EntityManager object.
      Returns:
      The list of collection.
    • getMatchedClientRole

      public static ClientRole getMatchedClientRole(Set<ClientRole> clientRoles, ClientRole requestClientRole)
      This method return the matched client role from the set.
      Parameters:
      clientRoles - a Set of ClientRole objects.
      requestClientRole - a ClientRole object.
      Returns:
      a ClientRole object.