Class SearchSecurityRuleTranslator


  • public final class SearchSecurityRuleTranslator
    extends Object
    Author:
    npiedeloup
    • Field Detail

      • EMPTY_QUERY_PATTERN

        protected static final Pattern EMPTY_QUERY_PATTERN
    • Constructor Detail

      • SearchSecurityRuleTranslator

        public SearchSecurityRuleTranslator()
    • Method Detail

      • toSearchQuery

        public String toSearchQuery()
        Returns:
        This security rule as search Query
      • on

        public S on​(SecuredEntity securedEntity)
        Specifies the protected entity we are working on
        Parameters:
        securedEntity - the entity
        Returns:
        this builder
      • withRule

        public final S withRule​(RuleMultiExpression securityMultiExpression)
        Set security pattern.
        Parameters:
        securityMultiExpression - security parsed expression
        Returns:
        this builder
      • withRule

        public final S withRule​(String securityRule)
        Set security pattern.
        Parameters:
        securityRule - security Pattern (not null, could be empty)
        Returns:
        this builder
      • withSecurityKeys

        public final S withSecurityKeys​(Map<String,​List<Serializable>> userCriteria)
        Set criteria.
        Parameters:
        userCriteria - Criteria
        Returns:
        this builder
      • isSimpleSecurityField

        protected final boolean isSimpleSecurityField​(String fieldName)
      • lastIndexNotNull

        protected static <K> int lastIndexNotNull​(K[] value)
      • cleanQuery

        protected static String cleanQuery​(String query)