Class AccessRulesService

java.lang.Object
fr.paris.lutece.plugins.myluteceaccessrules.service.AccessRulesService

@ApplicationScoped @Named("accessRulesService") public class AccessRulesService extends Object
This class provides an Access Rules Service
  • Field Details

    • PARAMETER_NB_REDIRECT

      public static final String PARAMETER_NB_REDIRECT
      Parameter NB REDIRECT
      See Also:
    • 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:
    • I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED

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

      public static final String MARK_PUBLIC_LIST_URL
      The Constant MARK_PUBLIC_LIST_URL.
      See Also:
    • PUBLIC_URL_PREFIX

      public static final String PUBLIC_URL_PREFIX
      The Constant PUBLIC_URL_PREFIX.
      See Also:
    • MARK_PORTAL_AUTHENTICATION_REQUIRED

      public static final String MARK_PORTAL_AUTHENTICATION_REQUIRED
      The Constant MARK_PORTAL_AUTHENTICATION_REQUIRED.
      See Also:
    • PROPERTY_MAX_REDIRECT

      public static final String PROPERTY_MAX_REDIRECT
      Parameter NB REDIRECT
      See Also:
  • Constructor Details

    • AccessRulesService

      public AccessRulesService()
  • Method Details

    • isAccessRulesEnabled

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

      public AccessRulesCacheService getCache()
      Gets the cache.
      Returns:
      the cache
    • getRulesEnabled

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

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

      public boolean isRuleMatchingRequest(Rule rule, jakarta.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(jakarta.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, jakarta.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