org.mmbase.security
Class ActionRepository

java.lang.Object
  extended by org.mmbase.security.Configurable
      extended by org.mmbase.security.ActionRepository
Direct Known Subclasses:
MemoryActionRepository

public abstract class ActionRepository
extends Configurable

The defined 'actions' are maintained by the 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";
    }
    

Since:
MMBase-1.9
Version:
$Id: ActionRepository.java 41186 2010-02-26 17:54:31Z michiel $
Author:
Michiel Meeuwissen
See Also:
Action

Field Summary
protected static ActionRepository bootstrap
           
 
Fields inherited from class org.mmbase.security.Configurable
configResource, configWatcher, manager
 
Constructor Summary
ActionRepository()
           
 
Method Summary
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.
 
Methods inherited from class org.mmbase.security.Configurable
load, load
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bootstrap

protected static ActionRepository bootstrap
Constructor Detail

ActionRepository

public ActionRepository()
Method Detail

getInstance

public static final ActionRepository getInstance()
Returns the ActionRepository associated with the current MMBase's MMBaseCop. Or if that doesn't provide one, returns a MemoryActionRepository.


fillFromXml

public void fillFromXml(Element el,
                        String name)
Since:
MMBase-1.9.2

add

public abstract void add(Action a)
Adds the action to the repository using Action.getNameSpace() and Action.getName().


get

public abstract Map<String,Action> get(String nameSpace)
All actions of a certain namespace.


get

public final Action get(String nameSpace,
                        String name)
Shortcut for get(String).Map.get(java.lang.Object).


getActions

public abstract Collection<Action> getActions()
All actions managed by this repository



MMBase 2.0-SNAPSHOT - null