Class AccessRulesService
java.lang.Object
fr.paris.lutece.plugins.myluteceaccessrules.service.AccessRulesService
This class provides an Access Rules Service
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSession attribute that stores the LuteceUser object attached to the session.static final StringThe Constant I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED.static final StringThe Constant MARK_PORTAL_AUTHENTICATION_REQUIRED.static final StringThe Constant MARK_PUBLIC_LIST_URL.static final StringParameter NB REDIRECTstatic final StringParameter NB REDIRECTstatic final StringThe Constant PUBLIC_URL_PREFIX. -
Method Summary
Modifier and TypeMethodDescriptionbuildRedirectUrl(Rule rule, javax.servlet.http.HttpServletRequest request, int nbRedirect) Builds the redirect url depending to the rule specificationgeFirstRuleTriggered(javax.servlet.http.HttpServletRequest request) Ge the first rule triggered.getCache()Gets the cache.static AccessRulesServiceGet the unique instance of the AccessRulesServiceGets the list of enabled rulesbooleanChecks if is access rules enabled.booleanisRuleMatchingRequest(Rule rule, javax.servlet.http.HttpServletRequest request) Checks if this rule match the request.booleanmethod to test if the URL matches the pattern.
-
Field Details
-
PARAMETER_NB_REDIRECT
Parameter NB REDIRECT- See Also:
-
I18N_DEFAULT_MESSAGE_UNAUTHORIZED
Session attribute that stores the LuteceUser object attached to the session.- See Also:
-
I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED
The Constant I18N_DEFAULT_TITLE_MESSAGE_UNAUTHORIZED.- See Also:
-
MARK_PUBLIC_LIST_URL
The Constant MARK_PUBLIC_LIST_URL.- See Also:
-
PUBLIC_URL_PREFIX
The Constant PUBLIC_URL_PREFIX.- See Also:
-
MARK_PORTAL_AUTHENTICATION_REQUIRED
The Constant MARK_PORTAL_AUTHENTICATION_REQUIRED.- See Also:
-
PROPERTY_MAX_REDIRECT
Parameter NB REDIRECT- See Also:
-
-
Method Details
-
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
-
getCache
Gets the cache.- Returns:
- the cache
-
getRulesEnabled
Gets the list of enabled rules- Returns:
- the list of enabled rules
-
geFirstRuleTriggered
Ge the first rule triggered.- Parameters:
request- the request- Returns:
- the first Rule triggered
-
isRuleMatchingRequest
Checks if this rule match the request.- Parameters:
rule- the rulerequest- the request- Returns:
- if this rule match the request
-
matchUrl
method to test if the URL matches the pattern.- Parameters:
request- the requeststrUrlPatern- 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 rulerequest- the requestnbRedirect-- Returns:
- the redirect url
-