Package org.joinfaces.security
Class FaceletsTagUtils
- java.lang.Object
-
- org.joinfaces.security.FaceletsTagUtils
-
public final class FaceletsTagUtils extends java.lang.ObjectThis class provides static methods that are registered as EL functions and available for use in Unified EL expressions in standard Facelets views.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFaceletsTagUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanareAllGranted(java.lang.String authorities)Returns true if the user has all of of the given authorities.static booleanareAnyGranted(java.lang.String authorities)Returns true if the user has any of the given authorities.static booleanareNotGranted(java.lang.String authorities)Returns true if the user does not have any of the given authorities.static booleanisAllowed(java.lang.String url, java.lang.String method)Returns true if the user is allowed to access the given URL and HTTP method combination.static booleanisAnonymous()Returns true if user is anonymous.static booleanisAuthenticated()Returns true if the user is not anonymous.static booleanisFullyAuthenticated()Returns true if the is not an anonymous or a remember-me user.
-
-
-
Method Detail
-
areAllGranted
public static boolean areAllGranted(java.lang.String authorities) throws java.io.IOExceptionReturns true if the user has all of of the given authorities.- Parameters:
authorities- a comma-separated list of user authorities.- Returns:
- computation if the user has all of of the given authorities
- Throws:
java.io.IOException- io exception
-
areAnyGranted
public static boolean areAnyGranted(java.lang.String authorities) throws java.io.IOExceptionReturns true if the user has any of the given authorities.- Parameters:
authorities- a comma-separated list of user authorities.- Returns:
- computation if the user has any of the given authorities.
- Throws:
java.io.IOException- io exception
-
areNotGranted
public static boolean areNotGranted(java.lang.String authorities) throws java.io.IOExceptionReturns true if the user does not have any of the given authorities.- Parameters:
authorities- a comma-separated list of user authorities.- Returns:
- computation if the user does not have any of the given authorities.
- Throws:
java.io.IOException- io exception
-
isAllowed
public static boolean isAllowed(java.lang.String url, java.lang.String method) throws java.io.IOExceptionReturns true if the user is allowed to access the given URL and HTTP method combination. The HTTP method is optional and case insensitive.- Parameters:
url- to be accessed.method- to be called.- Returns:
- computation if the user is allowed to access the given URL and HTTP method.
- Throws:
java.io.IOException- io exception
-
isAnonymous
public static boolean isAnonymous() throws java.io.IOExceptionReturns true if user is anonymous.- Returns:
- computation if the user is anonymous.
- Throws:
java.io.IOException- io exception
-
isAuthenticated
public static boolean isAuthenticated() throws java.io.IOExceptionReturns true if the user is not anonymous.- Returns:
- computation if the user is not anonymous.
- Throws:
java.io.IOException- io exception
-
isFullyAuthenticated
public static boolean isFullyAuthenticated() throws java.io.IOExceptionReturns true if the is not an anonymous or a remember-me user.- Returns:
- computation if the user is not an anonymous or a remember-me user.
- Throws:
java.io.IOException- io exception
-
-