Class MemoryModelManagerImpl
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.fulcrum.security.spi.AbstractManager
org.apache.fulcrum.security.model.dynamic.AbstractDynamicModelManager
org.apache.fulcrum.security.memory.dynamic.MemoryModelManagerImpl
- All Implemented Interfaces:
Serializable
,org.apache.avalon.framework.activity.Disposable
,org.apache.avalon.framework.logger.LogEnabled
,org.apache.avalon.framework.service.Serviceable
,org.apache.avalon.framework.thread.ThreadSafe
,DynamicModelManager
,ModelManager
public class MemoryModelManagerImpl
extends AbstractDynamicModelManager
implements DynamicModelManager
This implementation keeps all objects in memory. This is mostly meant to help
with testing and prototyping of ideas.
- Version:
- $Id$
- Author:
- Eric Pugh
- See Also:
-
Field Summary
Fields inherited from class org.apache.fulcrum.security.spi.AbstractManager
manager
Fields inherited from interface org.apache.fulcrum.security.ModelManager
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Grants a Role to a Groupvoid
grant
(Role role, Permission permission) Grants a Role a Permissionvoid
Puts a user in a group.void
Revokes a Role from a Group.void
revoke
(Role role, Permission permission) Revokes a Permission from a Role.void
Revokes a user from a groupMethods inherited from class org.apache.fulcrum.security.model.dynamic.AbstractDynamicModelManager
addDelegate, removeDelegate, revokeAll, revokeAll, revokeAll, revokeAll
Methods inherited from class org.apache.fulcrum.security.spi.AbstractManager
dispose, getGroupManager, getPermissionManager, getRoleManager, getServiceManager, getUserManager, release, resolve, service
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.fulcrum.security.model.dynamic.DynamicModelManager
addDelegate, removeDelegate, revokeAll, revokeAll, revokeAll, revokeAll
-
Constructor Details
-
MemoryModelManagerImpl
public MemoryModelManagerImpl()
-
-
Method Details
-
grant
Puts a user in a group. This method is used when adding a user to a group- Specified by:
grant
in interfaceDynamicModelManager
- Parameters:
user
- the User.group
- the Group- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the account is not present.
-
revoke
Revokes a user from a group- Specified by:
revoke
in interfaceDynamicModelManager
- Parameters:
user
- the User.group
- the Group- Throws:
DataBackendException
- if there was an error accessing the data backendUnknownEntityException
- if the user or group is not present.
-
grant
Grants a Role to a Group- Specified by:
grant
in interfaceDynamicModelManager
- Parameters:
group
- the Group.role
- the Role.- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if group or role is not present.
-
revoke
Revokes a Role from a Group.- Specified by:
revoke
in interfaceDynamicModelManager
- Parameters:
group
- the Group.role
- the Role.- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if group or role is not present.
-
grant
public void grant(Role role, Permission permission) throws DataBackendException, UnknownEntityException Grants a Role a Permission- Specified by:
grant
in interfaceDynamicModelManager
- Parameters:
role
- the Role.permission
- the Permission.- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if role or permission is not present.
-
revoke
public void revoke(Role role, Permission permission) throws DataBackendException, UnknownEntityException Revokes a Permission from a Role.- Specified by:
revoke
in interfaceDynamicModelManager
- Parameters:
role
- the Role.permission
- the Permission.- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if role or permission is not present.
-