org.apache.turbine.om.security
Class TurbineRole
java.lang.Object
|
+--org.apache.turbine.om.BaseObject
|
+--org.apache.turbine.om.security.SecurityObject
|
+--org.apache.turbine.om.security.TurbineRole
- All Implemented Interfaces:
- java.lang.Comparable, Persistent, Role, SecurityEntity, java.io.Serializable
- public class TurbineRole
- extends SecurityObject
- implements Role
This class represents a role played by the User associated with the
current Session.
- Version:
- $Id$
- Author:
- Frank Y. Kim, John D. McNally, Brett McLaughlin
- See Also:
- Serialized Form
Constructor Summary |
TurbineRole()
Constructs a new Role |
TurbineRole(java.lang.String name)
Constructs a new Role with the sepcified name. |
Method Summary |
Role |
create(java.lang.String name)
Creates a new Role in the system. |
PermissionSet |
getPermissions()
Returns the set of Permissions associated with this Role. |
void |
grant(Permission permission)
Grants a Permission to this Role. |
void |
grant(PermissionSet permissionSet)
Grants Permissions from a PermissionSet to this Role. |
void |
remove()
Removes a role from the system. |
void |
rename(java.lang.String name)
Renames the role. |
void |
revoke(Permission permission)
Revokes a Permission from this Role. |
void |
revoke(PermissionSet permissionSet)
Revokes Permissions from a PermissionSet from this Role. |
void |
save()
Makes changes made to the Role attributes permanent. |
void |
setPermissions(PermissionSet permissionSet)
Sets the Permissions associated with this Role. |
Methods inherited from class org.apache.turbine.om.BaseObject |
equals, equals, getByName, getByPeerName, getByPosition, getPrimaryKey, getPrimaryKeyAsBigDecimal, getPrimaryKeyAsInt, getPrimaryKeyAsLong, getPrimaryKeyAsString, hashCode, isModified, isNew, resetModified, setModified, setNew, setPrimaryKey, setPrimaryKey, setPrimaryKey, setPrimaryKey, setPrimaryKey |
Methods inherited from class java.lang.Object |
, clone, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait |
permissionSet
private PermissionSet permissionSet
- The permissions for this role.
TurbineRole
public TurbineRole()
- Constructs a new Role
TurbineRole
public TurbineRole(java.lang.String name)
- Constructs a new Role with the sepcified name.
- Parameters:
name
- The name of the new object.
getPermissions
public PermissionSet getPermissions()
throws java.lang.Exception
- Returns the set of Permissions associated with this Role.
- Specified by:
getPermissions
in interface Role
- Returns:
- A PermissionSet.
- Throws:
Exception,
- a generic exception.
setPermissions
public void setPermissions(PermissionSet permissionSet)
- Sets the Permissions associated with this Role.
- Specified by:
setPermissions
in interface Role
- Parameters:
permissionSet
- A PermissionSet.
create
public Role create(java.lang.String name)
throws TurbineSecurityException
- Creates a new Role in the system.
- Specified by:
create
in interface Role
- Parameters:
name
- The name of the new Role.- Returns:
- An object representing the new Role.
- Throws:
TurbineSecurityException
- if the Role could not be created.
save
public void save()
throws TurbineSecurityException
- Makes changes made to the Role attributes permanent.
- Specified by:
save
in interface Role
- Overrides:
save
in class BaseObject
- Throws:
TurbineSecurityException
- if there is a problem while
saving data.
remove
public void remove()
throws TurbineSecurityException
- Removes a role from the system.
- Specified by:
remove
in interface Role
- Throws:
TurbineSecurityException
- if the Role could not be removed.
rename
public void rename(java.lang.String name)
throws TurbineSecurityException
- Renames the role.
- Specified by:
rename
in interface Role
- Parameters:
name
- The new Role name.- Throws:
TurbineSecurityException
- if the Role could not be renamed.
grant
public void grant(Permission permission)
throws TurbineSecurityException
- Grants a Permission to this Role.
- Specified by:
grant
in interface Role
- Parameters:
permission
- A Permission.- Throws:
TurbineSecurityException
- if there is a problem while assigning
the Permission.
grant
public void grant(PermissionSet permissionSet)
throws TurbineSecurityException
- Grants Permissions from a PermissionSet to this Role.
- Specified by:
grant
in interface Role
- Parameters:
permissionSet
- A PermissionSet.- Throws:
TurbineSecurityException
- if there is a problem while assigning
the Permissions.
revoke
public void revoke(Permission permission)
throws TurbineSecurityException
- Revokes a Permission from this Role.
- Specified by:
revoke
in interface Role
- Parameters:
permission
- A Permission.- Throws:
TurbineSecurityException
- if there is a problem while unassigning
the Permission.
revoke
public void revoke(PermissionSet permissionSet)
throws TurbineSecurityException
- Revokes Permissions from a PermissionSet from this Role.
- Specified by:
revoke
in interface Role
- Parameters:
permissionSet
- A PermissionSet.- Throws:
TurbineSecurityException
- if there is a problem while unassigning
the Permissions.
Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.