org.apache.turbine.om.security
Class TurbineRole

java.lang.Object
  extended byorg.apache.torque.om.BaseObject
      extended byorg.apache.turbine.om.security.SecurityObject
          extended byorg.apache.turbine.om.security.TurbineRole
All Implemented Interfaces:
java.lang.Comparable, org.apache.torque.om.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: TurbineRole.java 278822 2005-09-05 19:53:05Z henning $
Author:
Frank Y. Kim, John D. McNally, Brett McLaughlin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.torque.om.BaseObject
NEW_ID
 
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 save(java.sql.Connection conn)
          not implemented
 void save(java.lang.String dbname)
          not implemented
 void setPermissions(PermissionSet permissionSet)
          Sets the Permissions associated with this Role.
 
Methods inherited from class org.apache.turbine.om.security.SecurityObject
compareTo, getAttribute, getAttributes, getId, getIdAsObj, getName, setAttribute, setAttributes, setId, setName, toString
 
Methods inherited from class org.apache.torque.om.BaseObject
equals, equals, getByName, getByPeerName, getByPosition, getLog, getPrimaryKey, hashCode, isModified, isNew, log, resetModified, setModified, setNew, setPrimaryKey, setPrimaryKey, setPrimaryKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.om.security.SecurityEntity
getId, getIdAsObj, getName, setId, setName
 

Constructor Detail

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.
Method Detail

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:
java.lang.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
Throws:
TurbineSecurityException - if there is a problem while saving data.

save

public void save(java.sql.Connection conn)
          throws java.lang.Exception
not implemented

Specified by:
save in interface org.apache.torque.om.Persistent
Parameters:
conn -
Throws:
java.lang.Exception

save

public void save(java.lang.String dbname)
          throws java.lang.Exception
not implemented

Specified by:
save in interface org.apache.torque.om.Persistent
Parameters:
dbname -
Throws:
java.lang.Exception

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 © 2000-2005 Apache Software Foundation. All Rights Reserved.