Package com.skava.auth.util
Class UserRoleUtil
java.lang.Object
com.skava.auth.util.UserRoleUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.persistence.criteria.Predicate
addUserIdsPredicate
(jakarta.persistence.criteria.Predicate userRoleSearchPredicate, List<Long> resultUserIds, jakarta.persistence.criteria.Root<UserRole> root, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) static List<jakarta.persistence.Tuple>
getDistinctUserIds
(int page, int size, jakarta.persistence.criteria.CriteriaQuery<jakarta.persistence.Tuple> selectDistinctUserQuery, jakarta.persistence.criteria.Root<UserRole> root, jakarta.persistence.criteria.Predicate userRoleSearchPredicate, jakarta.persistence.EntityManager entityManager) static UserRole
getMatchedUserRole
(Set<UserRole> userRoles, UserRole requestUserRole) This method return the matched user role from the set.static jakarta.persistence.criteria.Predicate
getUserRoleSearchPredicate
(Long collectionId, List<SearchCriteria> params, jakarta.persistence.criteria.Root<UserRole> root, jakarta.persistence.criteria.CriteriaBuilder builder) This method is used to search auth group.static void
preAuthorizeForUserRoleSearch
(boolean isSuperAdmin, boolean hasCollectionAccess, boolean hasSelfAccess, boolean hasBusinessAccess, org.springframework.context.MessageSource messageSource) static UsersRolesResponse
searchUserRoles
(Long collectionId, Boolean skipPagination, UsersRoleRequest input, List<SearchCriteria> params, AuthCommonServices authCommonServices, jakarta.persistence.EntityManager entityManager) This method is used to search collection.searchUserRolesByUserId
(String sort, org.springframework.data.jpa.domain.Specification<UserRole> userRoleSpecification, UserRoleRepository userRoleRepository, org.springframework.context.MessageSource messageSource) static UsersRolesResponse
searchUsersRoles
(Long collectionId, int page, int size, List<SearchCriteria> params, jakarta.persistence.EntityManager entityManager, UserRoleRepository userRoleRepository) static boolean
validateUserCount
(int userCount, org.springframework.context.MessageSource messageSource)
-
Method Details
-
addUserIdsPredicate
-
getDistinctUserIds
public static List<jakarta.persistence.Tuple> getDistinctUserIds(int page, int size, jakarta.persistence.criteria.CriteriaQuery<jakarta.persistence.Tuple> selectDistinctUserQuery, jakarta.persistence.criteria.Root<UserRole> root, jakarta.persistence.criteria.Predicate userRoleSearchPredicate, jakarta.persistence.EntityManager entityManager) -
preAuthorizeForUserRoleSearch
public static void preAuthorizeForUserRoleSearch(boolean isSuperAdmin, boolean hasCollectionAccess, boolean hasSelfAccess, boolean hasBusinessAccess, org.springframework.context.MessageSource messageSource) -
validateUserCount
public static boolean validateUserCount(int userCount, org.springframework.context.MessageSource messageSource) -
getUserRoleSearchPredicate
public static jakarta.persistence.criteria.Predicate getUserRoleSearchPredicate(Long collectionId, List<SearchCriteria> params, jakarta.persistence.criteria.Root<UserRole> root, jakarta.persistence.criteria.CriteriaBuilder builder) This method is used to search auth group. -
searchUsersRoles
public static UsersRolesResponse searchUsersRoles(Long collectionId, int page, int size, List<SearchCriteria> params, jakarta.persistence.EntityManager entityManager, UserRoleRepository userRoleRepository) -
searchUserRolesByUserId
public static List<UserRole> searchUserRolesByUserId(String sort, org.springframework.data.jpa.domain.Specification<UserRole> userRoleSpecification, UserRoleRepository userRoleRepository, org.springframework.context.MessageSource messageSource) -
searchUserRoles
public static UsersRolesResponse searchUserRoles(Long collectionId, Boolean skipPagination, UsersRoleRequest input, List<SearchCriteria> params, AuthCommonServices authCommonServices, jakarta.persistence.EntityManager entityManager) This method is used to search collection.- Parameters:
collectionId
- aLong
object.input
- aUsersRoleRequest
object.params
- a list ofSearchCriteria
object.skipPagination
- aBoolean
object.authCommonServices
- aAuthCommonServices
object.entityManager
- aEntityManager
object.- Returns:
- The list of collection.
-
getMatchedUserRole
This method return the matched user role from the set.
-