org.apache.jetspeed.services.security.nosecurity
Class NoPermissionManagement

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.jetspeed.services.security.nosecurity.NoPermissionManagement
All Implemented Interfaces:
org.apache.turbine.services.Initable, PermissionManagement, org.apache.turbine.services.Service

public class NoPermissionManagement
extends org.apache.turbine.services.TurbineBaseService
implements PermissionManagement

The NoPermissionManagement class is a Jetspeed security provider, implementing the PermissionManagement interface. It provides no permission management - no roles have permissions, no permissions are saved, and requests for any permission is satisfied with a temp. Permission object.

Version:
$Id: NoPermissionManagement.java,v 1.3 2004/02/23 03:53:24 jford Exp $
Author:
Glenn R. Golden

Field Summary
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, properties, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.jetspeed.services.security.PermissionManagement
SERVICE_NAME
 
Constructor Summary
NoPermissionManagement()
           
 
Method Summary
 void addPermission(Permission permission)
          Adds a Permission into permanent storage.
 Permission getPermission(java.lang.String permissionName)
          Retrieves a single Permission for a given permissionName principal.
 java.util.Iterator getPermissions()
          Retrieves all Permissions.
 java.util.Iterator getPermissions(java.lang.String rolename)
          Retrieves all Permissions for a given rolename principal.
 void grantPermission(java.lang.String roleName, java.lang.String permissionName)
          Grants a permission to a role.
 boolean hasPermission(java.lang.String roleName, java.lang.String permissionName)
          Checks for the relationship of role has a permission.
 void removePermission(java.lang.String permissionName)
          Removes a Permission from the permanent store.
 void revokePermission(java.lang.String roleName, java.lang.String permissionName)
          Revokes a permission from a role.
 void savePermission(Permission permission)
          Saves a Permission into permanent storage.
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, init, init, shutdown
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Constructor Detail

NoPermissionManagement

public NoPermissionManagement()
Method Detail

getPermissions

public java.util.Iterator getPermissions(java.lang.String rolename)
                                  throws JetspeedSecurityException
Retrieves all Permissions for a given rolename principal. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Specified by:
getPermissions in interface PermissionManagement
Parameters:
rolename - a role name identity to be retrieved.
Returns:
Iterator over all permissions associated to the role principal.
Throws:
PermissionException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

getPermissions

public java.util.Iterator getPermissions()
                                  throws JetspeedSecurityException
Retrieves all Permissions. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Specified by:
getPermissions in interface PermissionManagement
Returns:
Iterator over all permissions.
Throws:
PermissionException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

addPermission

public void addPermission(Permission permission)
                   throws JetspeedSecurityException
Adds a Permission into permanent storage. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Specified by:
addPermission in interface PermissionManagement
Throws:
PermissionException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

savePermission

public void savePermission(Permission permission)
                    throws JetspeedSecurityException
Saves a Permission into permanent storage. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Specified by:
savePermission in interface PermissionManagement
Throws:
PermissionException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

removePermission

public void removePermission(java.lang.String permissionName)
                      throws JetspeedSecurityException
Removes a Permission from the permanent store. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Specified by:
removePermission in interface PermissionManagement
Parameters:
permissionName - the principal identity of the permission to be retrieved.
Throws:
PermissionException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

grantPermission

public void grantPermission(java.lang.String roleName,
                            java.lang.String permissionName)
                     throws JetspeedSecurityException
Grants a permission to a role. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Specified by:
grantPermission in interface PermissionManagement
Parameters:
roleName - grant a permission to this role.
permissionName - the permission to grant to the role.
Throws:
PermissionException - when the security provider has a general failure retrieving permissions.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

revokePermission

public void revokePermission(java.lang.String roleName,
                             java.lang.String permissionName)
                      throws JetspeedSecurityException
Revokes a permission from a role. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Specified by:
revokePermission in interface PermissionManagement
Parameters:
roleName - grant a permission to this role.
permissionName - the permission to grant to the role.
Throws:
PermissionException - when the security provider has a general failure retrieving permissions.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

hasPermission

public boolean hasPermission(java.lang.String roleName,
                             java.lang.String permissionName)
                      throws JetspeedSecurityException
Checks for the relationship of role has a permission. Returns true when the role has the given permission. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Specified by:
hasPermission in interface PermissionManagement
Parameters:
roleName - grant a permission to this role.
permissionName - the permission to grant to the role.
Throws:
PermissionException - when the security provider has a general failure retrieving permissions.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException

getPermission

public Permission getPermission(java.lang.String permissionName)
                         throws JetspeedSecurityException
Retrieves a single Permission for a given permissionName principal. The security service may optionally check the current user context to determine if the requestor has permission to perform this action.

Specified by:
getPermission in interface PermissionManagement
Parameters:
permissionName - a permission principal identity to be retrieved.
Returns:
Permission the permission record retrieved.
Throws:
PermissionException - when the security provider has a general failure.
InsufficientPrivilegeException - when the requestor is denied due to insufficient privilege
JetspeedSecurityException


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