org.apache.turbine.om.security
Interface Role

All Superinterfaces:
SecurityEntity, java.io.Serializable
All Known Implementing Classes:
TorqueRole

public interface Role
extends SecurityEntity, java.io.Serializable

This class represents a role played by the User associated with the current Session.

Version:
$Id: Role.java 534527 2007-05-02 16:10:59Z tv $
Author:
Frank Y. Kim, John D. McNally, Brett McLaughlin, Henning P. Schmiedehausen

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 interface org.apache.turbine.om.security.SecurityEntity
getId, getIdAsObj, getName, setId, setName
 

Method Detail

getPermissions

public PermissionSet getPermissions()
                             throws java.lang.Exception
Returns the set of Permissions associated with this Role.

Returns:
A PermissionSet.
Throws:
java.lang.Exception - A generic exception.

setPermissions

public void setPermissions(PermissionSet permissionSet)
Sets the Permissions associated with this Role.

Parameters:
permissionSet - A PermissionSet.

create

public Role create(java.lang.String name)
            throws TurbineSecurityException
Creates a new Role in the system.

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.

Throws:
TurbineSecurityException - if there is a problem while saving data.

remove

public void remove()
            throws TurbineSecurityException
Removes a role from the system.

Throws:
TurbineSecurityException - if the Role could not be removed.

rename

public void rename(java.lang.String name)
            throws TurbineSecurityException
Renames the 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.

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.

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.

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.

Parameters:
permissionSet - A PermissionSet.
Throws:
TurbineSecurityException - if there is a problem while unassigning the Permissions.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.