public class DefaultActionFilter extends Object implements ActionFilter, Cloneable
Modifier and Type | Field and Description |
---|---|
static String |
PRECOMPUTED_KEY |
Constructor and Description |
---|
DefaultActionFilter() |
DefaultActionFilter(String id,
FilterRule[] rules) |
DefaultActionFilter(String id,
FilterRule[] rules,
boolean append) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Action action,
ActionContext context)
Checks whether this action is valid in the given context.
|
DefaultActionFilter |
clone()
Returns a clone, useful for hot reload.
|
boolean |
equals(Object obj)
Equals method added to handle hot reload of inner filters, see NXP-9677
|
boolean |
getAppend() |
String |
getId() |
FilterRule[] |
getRules() |
void |
setAppend(boolean append) |
void |
setId(String id) |
void |
setRules(FilterRule[] rules) |
public static final String PRECOMPUTED_KEY
public DefaultActionFilter()
public DefaultActionFilter(String id, FilterRule[] rules)
public DefaultActionFilter(String id, FilterRule[] rules, boolean append)
public String getId()
getId
in interface ActionFilter
public void setId(String id)
setId
in interface ActionFilter
public FilterRule[] getRules()
public void setRules(FilterRule[] rules)
public boolean accept(Action action, ActionContext context)
ActionFilter
The action is considered valid if no denying rule is found and at least one granting rule is found. If no rule is found at all, it is valid.
In other words: OR between granting rules, AND between denying rules, denial is favored (also if exceptions occur), AND inside of rules, OR inside or rule items (type, facet,...).
accept
in interface ActionFilter
action
- the optional action to check against, should be able to be
null if filters evaluation only depends on given context.context
- mandatory context holding variables to check against.public boolean getAppend()
public void setAppend(boolean append)
public DefaultActionFilter clone()
ActionFilter
clone
in interface ActionFilter
clone
in class Object
Copyright © 2013 Nuxeo SA. All Rights Reserved.