Class AccessRulesService


  • public final class AccessRulesService
    extends Object
    This class provides an Access Rules Service
    • Field Detail

      • I18N_DEFAULT_MESSAGE_UNAUTHORIZED

        public static final String I18N_DEFAULT_MESSAGE_UNAUTHORIZED
        Session attribute that stores the LuteceUser object attached to the session.
        See Also:
        Constant Field Values
      • I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED

        public static final String I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED
        The Constant I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED.
        See Also:
        Constant Field Values
      • MARK_PUBLIC_LIST_URL

        public static final String MARK_PUBLIC_LIST_URL
        The Constant MARK_PUBLIC_LIST_URL.
        See Also:
        Constant Field Values
      • MARK_PORTAL_AUTHENTICATION_REQUIRED

        public static final String MARK_PORTAL_AUTHENTICATION_REQUIRED
        The Constant MARK_PORTAL_AUTHENTICATION_REQUIRED.
        See Also:
        Constant Field Values
    • Method Detail

      • getInstance

        public static AccessRulesService getInstance()
        Get the unique instance of the AccessRulesService
        Returns:
        The instance
      • isAccessRulesEnabled

        public boolean isAccessRulesEnabled()
        Checks if is access rules enabled.
        Returns:
        true, if is access rules enabled
      • getRulesEnabled

        public List<Rule> getRulesEnabled()
        Gets the list of enabled rules
        Returns:
        the list of enabled rules
      • geFirstRuleTriggered

        public Rule geFirstRuleTriggered​(javax.servlet.http.HttpServletRequest request)
        Ge the first rule triggered.
        Parameters:
        request - the request
        Returns:
        the first Rule triggered
      • isRuleMatchingRequest

        public boolean isRuleMatchingRequest​(Rule rule,
                                             javax.servlet.http.HttpServletRequest request)
        Checks if this rule match the request.
        Parameters:
        rule - the rule
        request - the request
        Returns:
        if this rule match the request
      • matchUrl

        public boolean matchUrl​(javax.servlet.http.HttpServletRequest request,
                                String strUrlPatern)
        method to test if the URL matches the pattern.
        Parameters:
        request - the request
        strUrlPatern - the pattern
        Returns:
        true if the URL matches the pattern
      • buildRedirectUrl

        public String buildRedirectUrl​(Rule rule,
                                       javax.servlet.http.HttpServletRequest request,
                                       int nbRedirect)
        Builds the redirect url depending to the rule specification
        Parameters:
        rule - the rule
        request - the request
        nbRedirect -
        Returns:
        the redirect url