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 String
hasAnyAuthorityExpr(Collection<String> roles, Function<String,String> ensurePrefixFunction)
Builds thehasAnyAuthority
expression.static String
hasAuthorityExpr(String role, Function<String,String> ensurePrefixFunction)
Builds thehasAuthority
expression.static String
hasAuthorityOrIpAddressExpr(Collection<String> roles, Function<String,String> ensurePrefixFunction, Collection<String> ips)
Builds an access expression from the given roles and ip addresses.static String
hasIpAddressExpr(String ip)
Builds thehasIpAddress
expression.static String
hasIpAddressExpr(Collection<String> ips)
Builds thehasIpAddress
expression.
-
-
-
Method Detail
-
hasAuthorityExpr
public static String hasAuthorityExpr(String role, Function<String,String> ensurePrefixFunction)
Builds thehasAuthority
expression.- Parameters:
role
- the roleensurePrefixFunction
- the ensure prefix function- Returns:
- the
hasAuthority
expression
-
hasAnyAuthorityExpr
public static String hasAnyAuthorityExpr(Collection<String> roles, Function<String,String> ensurePrefixFunction)
Builds thehasAnyAuthority
expression.- Parameters:
roles
- the rolesensurePrefixFunction
- the ensure prefix function- Returns:
- the
hasAnyAuthority
expression
-
hasIpAddressExpr
public static String hasIpAddressExpr(String ip)
Builds thehasIpAddress
expression.- Parameters:
ip
- the ip- Returns:
- the
hasIpAddress
expression
-
hasIpAddressExpr
public static String hasIpAddressExpr(Collection<String> ips)
Builds thehasIpAddress
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 rolesensurePrefixFunction
- the ensure prefix functionips
- the ips- Returns:
- the access expression
-
-