Interface TurbineModelManager
-
- All Superinterfaces:
ModelManager,Serializable
- All Known Implementing Classes:
AbstractTurbineModelManager
public interface TurbineModelManager extends ModelManager
Describes all the relationships between entities in the "Turbine" model.- Version:
- $Id$
- Author:
- Eric Pugh
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTurbineModelManager.Privilegemay be used in implementations
-
Field Summary
Fields Modifier and Type Field Description static StringGLOBAL_GROUP_ATTR_NAMEattribute where global group name could be setstatic StringGLOBAL_GROUP_NAMEThe name of the global group, if no global group name is set in model manager-
Fields inherited from interface org.apache.fulcrum.security.ModelManager
ROLE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GroupgetGlobalGroup()Provides a reference to the Group object that represents the global group.StringgetGlobalGroupName()voidgrant(Role role, Permission permission)Puts a permission in a role This method is used when adding a permission to a rolevoidgrant(User user, Group group, Role role)Grant an User a Role in a Group.voidreplace(User user, Role oldRole, Role newRole)Replaces the assigned old Role to new role in the #global group for User user.voidrevoke(Role role, Permission permission)Removes a permission from a rolevoidrevoke(User user, Group group, Role role)Revoke a Role in a Group from an User.voidrevokeAll(Group group)Revokes all roles and users from a Group.voidrevokeAll(Role role)Revokes all permissions from a Role.voidrevokeAll(Role role, boolean cascadeDelete)Revokes by default all permissions from a Role and if flag is set all groups and users for this role This method is used when deleting a Role.voidrevokeAll(User user)Revokes all roles from an User.
-
-
-
Field Detail
-
GLOBAL_GROUP_ATTR_NAME
static final String GLOBAL_GROUP_ATTR_NAME
attribute where global group name could be set- See Also:
- Constant Field Values
-
GLOBAL_GROUP_NAME
static final String GLOBAL_GROUP_NAME
The name of the global group, if no global group name is set in model manager- See Also:
- Constant Field Values
-
-
Method Detail
-
getGlobalGroup
Group getGlobalGroup() throws DataBackendException
Provides a reference to the Group object that represents the global group.- Returns:
- A Group object that represents the global group.
- Throws:
DataBackendException- generic exception
-
getGlobalGroupName
String getGlobalGroupName()
- Returns:
- the configured global group name, by default
GLOBAL_GROUP_ATTR_NAME
-
replace
void replace(User user, Role oldRole, Role newRole) throws DataBackendException, UnknownEntityException
Replaces the assigned old Role to new role in the #global group for User user.- Parameters:
user- the User.oldRole- the old RolenewRole- the new Role- Throws:
DataBackendException- generic exceptionUnknownEntityException- generic exception
-
grant
void grant(Role role, Permission permission) throws DataBackendException, UnknownEntityException
Puts a permission in a role This method is used when adding a permission to a role- Parameters:
role- the Role.permission- the Permission- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the account is not present.
-
revoke
void revoke(Role role, Permission permission) throws DataBackendException, UnknownEntityException
Removes a permission from a role- Parameters:
role- the Role.permission- the Permission- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the role or permission is not present.
-
revokeAll
void revokeAll(User user) throws DataBackendException, UnknownEntityException
Revokes all roles from an User. This method is typically used when deleting an account.- Parameters:
user- the User.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the account is not present.
-
revokeAll
void revokeAll(Role role) throws DataBackendException, UnknownEntityException
Revokes all permissions from a Role. This method is typically used when deleting a Role.- Parameters:
role- the Role- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the Role is not present.
-
revokeAll
void revokeAll(Group group) throws DataBackendException, UnknownEntityException
Revokes all roles and users from a Group. This method is typically used when deleting a Group.- Parameters:
group- the Group- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the Group is not present.
-
grant
void grant(User user, Group group, Role role) throws DataBackendException, UnknownEntityException
Grant an User a Role in a Group.- Parameters:
user- the user.group- the group.role- the role.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if user account, group or role is not present.
-
revoke
void revoke(User user, Group group, Role role) throws DataBackendException, UnknownEntityException
Revoke a Role in a Group from an User.- Parameters:
user- the user.group- the group.role- the role.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if user account, group or role is not present.
-
revokeAll
void revokeAll(Role role, boolean cascadeDelete) throws DataBackendException, UnknownEntityException
Revokes by default all permissions from a Role and if flag is set all groups and users for this role This method is used when deleting a Role.- Parameters:
role- the RolecascadeDelete- iftrueremoves all groups and user for this role.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the Role is not present.
-
-