Class AccessExpressionUtils


  • public abstract class AccessExpressionUtils
    extends Object
    The access expression utilities.
    Author:
    Christian Bremer
    • Method Detail

      • hasAuthorityExpr

        public static String hasAuthorityExpr​(String role,
                                              Function<String,​String> ensurePrefixFunction)
        Builds the hasAuthority expression.
        Parameters:
        role - the role
        ensurePrefixFunction - the ensure prefix function
        Returns:
        the hasAuthority expression
      • hasAnyAuthorityExpr

        public static String hasAnyAuthorityExpr​(Collection<String> roles,
                                                 Function<String,​String> ensurePrefixFunction)
        Builds the hasAnyAuthority expression.
        Parameters:
        roles - the roles
        ensurePrefixFunction - the ensure prefix function
        Returns:
        the hasAnyAuthority expression
      • hasIpAddressExpr

        public static String hasIpAddressExpr​(String ip)
        Builds the hasIpAddress expression.
        Parameters:
        ip - the ip
        Returns:
        the hasIpAddress expression
      • hasIpAddressExpr

        public static String hasIpAddressExpr​(Collection<String> ips)
        Builds the hasIpAddress expression.
        Parameters:
        ips - the ips
        Returns:
        the hasIpAddress expression
      • hasAuthorityOrIpAddressExpr

        public static String hasAuthorityOrIpAddressExpr​(Collection<String> roles,
                                                         Function<String,​String> ensurePrefixFunction,
                                                         Collection<String> ips)
        Builds an access expression from the given roles and ip addresses.
        Parameters:
        roles - the roles
        ensurePrefixFunction - the ensure prefix function
        ips - the ips
        Returns:
        the access expression