Class AccessExpressionUtils
- java.lang.Object
-
- org.bremersee.security.authentication.AccessExpressionUtils
-
public abstract class AccessExpressionUtils extends Object
The access expression utilities.- Author:
- Christian Bremer
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringhasAnyAuthorityExpr(Collection<String> roles, Function<String,String> ensurePrefixFunction)Builds thehasAnyAuthorityexpression.static StringhasAuthorityExpr(String role, Function<String,String> ensurePrefixFunction)Builds thehasAuthorityexpression.static StringhasAuthorityOrIpAddressExpr(Collection<String> roles, Function<String,String> ensurePrefixFunction, Collection<String> ips)Builds an access expression from the given roles and ip addresses.static StringhasIpAddressExpr(String ip)Builds thehasIpAddressexpression.static StringhasIpAddressExpr(Collection<String> ips)Builds thehasIpAddressexpression.
-
-
-
Method Detail
-
hasAuthorityExpr
public static String hasAuthorityExpr(String role, Function<String,String> ensurePrefixFunction)
Builds thehasAuthorityexpression.- Parameters:
role- the roleensurePrefixFunction- the ensure prefix function- Returns:
- the
hasAuthorityexpression
-
hasAnyAuthorityExpr
public static String hasAnyAuthorityExpr(Collection<String> roles, Function<String,String> ensurePrefixFunction)
Builds thehasAnyAuthorityexpression.- Parameters:
roles- the rolesensurePrefixFunction- the ensure prefix function- Returns:
- the
hasAnyAuthorityexpression
-
hasIpAddressExpr
public static String hasIpAddressExpr(String ip)
Builds thehasIpAddressexpression.- Parameters:
ip- the ip- Returns:
- the
hasIpAddressexpression
-
hasIpAddressExpr
public static String hasIpAddressExpr(Collection<String> ips)
Builds thehasIpAddressexpression.- Parameters:
ips- the ips- Returns:
- the
hasIpAddressexpression
-
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 rolesensurePrefixFunction- the ensure prefix functionips- the ips- Returns:
- the access expression
-
-