public abstract class ActionRepository extends Configurable
Action repository. The security implementation can
decide how to persist actions and how to connect rights to it, and hence is responsible for
implementation this.
Every action is identified by two
strings: a namespace (which may be null) and it's name. Namespaces are likely to correspond with Components.
Action action = ActionRepository.getInstance().get("core", "viewsource");
Parameters params = action.createParameters();
// perhaps supply some parameters, not needed in this case (it may be null then too).
if (cloud.check(cloud.getUser(), action, parameters)) { // checks if current user may view the source
/// show the source..
...
} else {
return "not allowed to view the source";
}
Action| Modifier and Type | Field and Description |
|---|---|
protected static ActionRepository |
bootstrap |
configResource, configWatcher, manager| Constructor and Description |
|---|
ActionRepository() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
add(Action a)
Adds the action to the repository using
Action.getNameSpace() and Action.getName(). |
void |
fillFromXml(Element el,
String name) |
abstract Map<String,Action> |
get(String nameSpace)
All actions of a certain namespace.
|
Action |
get(String nameSpace,
String name)
Shortcut for
get(String).Map.get(java.lang.Object). |
abstract Collection<Action> |
getActions()
All actions managed by this repository
|
static ActionRepository |
getInstance()
Returns the ActionRepository associated with the current MMBase's
MMBaseCop. |
load, loadprotected static ActionRepository bootstrap
public static final ActionRepository getInstance()
MMBaseCop. Or if
that doesn't provide one, returns a MemoryActionRepository.public abstract void add(Action a)
Action.getNameSpace() and Action.getName().public final Action get(String nameSpace, String name)
get(String).Map.get(java.lang.Object).public abstract Collection<Action> getActions()
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}