|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.services.security.torque.TorqueObject org.apache.turbine.services.security.torque.TorqueRole
This class represents a role played by the User associated with the current Session. It is separated from the actual Torque peer object to be able to replace the Peer with an user supplied Peer (and Object)
Field Summary |
Fields inherited from class org.apache.turbine.services.security.torque.TorqueObject |
obj |
Constructor Summary | |
TorqueRole()
Constructs a new Role |
|
TorqueRole(org.apache.torque.om.Persistent obj)
The package private Constructor is used when the RolePeerManager has retrieved a list of Database Objects from the peer and must 'wrap' them into TorqueRole Objects. |
|
TorqueRole(java.lang.String name)
Constructs a new Role with the specified name. |
Method Summary | |
Role |
create(java.lang.String name)
Creates a new Role in the system. |
int |
getId()
Gets the Id of this object |
java.lang.Integer |
getIdAsObj()
Gets the Id of this object |
java.lang.String |
getName()
Returns the name of this role. |
PermissionSet |
getPermissions()
Returns the set of Permissions associated with this Role. |
org.apache.torque.om.Persistent |
getPersistentObj()
Returns the underlying Object for the Peer Used in the RolePeerManager when building a new Criteria. |
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 |
setId(int id)
Sets the Id of this object |
void |
setName(java.lang.String name)
Sets the name of this Role |
void |
setPermissions(PermissionSet permissionSet)
Sets the Permissions associated with this Role. |
Methods inherited from class org.apache.turbine.services.security.torque.TorqueObject |
compareTo, equals, equals, getPrimaryKey, hashCode, isModified, isNew, save, save, setModified, setNew, setPrimaryKey, setPrimaryKey |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
compareTo |
Constructor Detail |
public TorqueRole()
public TorqueRole(java.lang.String name)
name
- The name of the new object.public TorqueRole(org.apache.torque.om.Persistent obj)
obj
- An Object from the peerMethod Detail |
public org.apache.torque.om.Persistent getPersistentObj()
getPersistentObj
in class TorqueObject
public java.lang.String getName()
getName
in interface SecurityEntity
getName
in class TorqueObject
public void setName(java.lang.String name)
setName
in interface SecurityEntity
setName
in class TorqueObject
name
- The name of the role.public int getId()
getId
in interface SecurityEntity
public java.lang.Integer getIdAsObj()
getIdAsObj
in interface SecurityEntity
public void setId(int id)
setId
in interface SecurityEntity
id
- The new Idpublic PermissionSet getPermissions() throws java.lang.Exception
getPermissions
in interface Role
java.lang.Exception
- a generic exception.public void setPermissions(PermissionSet permissionSet)
setPermissions
in interface Role
permissionSet
- A PermissionSet.public Role create(java.lang.String name) throws TurbineSecurityException
create
in interface Role
name
- The name of the new Role.
TurbineSecurityException
- if the Role could not be created.public void save() throws TurbineSecurityException
save
in interface Role
save
in class TorqueObject
TurbineSecurityException
- if there is a problem while
saving data.public void remove() throws TurbineSecurityException
remove
in interface Role
TurbineSecurityException
- if the Role could not be removed.public void rename(java.lang.String name) throws TurbineSecurityException
rename
in interface Role
name
- The new Role name.
TurbineSecurityException
- if the Role could not be renamed.public void grant(Permission permission) throws TurbineSecurityException
grant
in interface Role
permission
- A Permission.
TurbineSecurityException
- if there is a problem while assigning
the Permission.public void grant(PermissionSet permissionSet) throws TurbineSecurityException
grant
in interface Role
permissionSet
- A PermissionSet.
TurbineSecurityException
- if there is a problem while assigning
the Permissions.public void revoke(Permission permission) throws TurbineSecurityException
revoke
in interface Role
permission
- A Permission.
TurbineSecurityException
- if there is a problem while unassigning
the Permission.public void revoke(PermissionSet permissionSet) throws TurbineSecurityException
revoke
in interface Role
permissionSet
- A PermissionSet.
TurbineSecurityException
- if there is a problem while unassigning
the Permissions.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |