org.apache.jetspeed.security.impl
Class PermissionManagerImpl

java.lang.Object
  extended byorg.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
      extended byorg.apache.jetspeed.security.impl.PermissionManagerImpl
All Implemented Interfaces:
org.apache.jetspeed.security.PermissionManager

public class PermissionManagerImpl
extends org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
implements org.apache.jetspeed.security.PermissionManager

Implementation for managing Permissionand permission association to Principal. Permissions are used to manage Principals access entitlement on specified resources.

For instance:


 
  
   grant principal o.a.j.security.UserPrincipal "theUserPrincipal"
   {
       permission o.a.j.security.PortletPermission "myportlet", "view,edit,minimize,maximize";
   };
   
  
 
 
  <pre>

Author:
<a href="mailto:dlestrat@apache.org">David Le Strat</a>

Field Summary
private static org.apache.commons.logging.Log log
           
 
Fields inherited from class org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
logger
 
Constructor Summary
PermissionManagerImpl()
           
 
Method Summary
 void addPermission(Permission permission)
           
private  Permissions appendSecurityPermissions(Collection omPermissions, Permissions permissions)
           Iterate through a collection of InternalPermissionand build a unique collection of Permission.
(package private)  org.apache.jetspeed.security.om.InternalPermission getInternalPermission(Permission permission)
           Returns the InternalPermission from a Permission.
(package private)  org.apache.jetspeed.security.om.InternalPrincipal getInternalPrincipal(String fullPath)
           Returns the InternalPrincipalfrom the full path.
 Permissions getPermissions(Collection principals)
           
 Permissions getPermissions(Principal principal)
           
private  Collection getPrincipalsFullPath(Collection principals)
           Get the full path for the Principalin the collection.
 void grantPermission(Principal principal, Permission permission)
           
 boolean permissionExists(Permission permission)
           
 void removePermission(Permission permission)
           
 void removePermissions(Principal principal)
           
 void revokePermission(Principal principal, Permission permission)
           
 
Methods inherited from class org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
afterPropertiesSet, closePersistenceBrokerIfNecessary, convertOjbAccessException, createPersistenceBrokerTemplate, getJcdAlias, getPersistenceBroker, getPersistenceBrokerTemplate, initDao, setJcdAlias, setPersistenceBrokerTemplate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
Constructor Detail

PermissionManagerImpl

public PermissionManagerImpl()
Method Detail

getPermissions

public Permissions getPermissions(Principal principal)
Specified by:
getPermissions in interface org.apache.jetspeed.security.PermissionManager
See Also:
PermissionManager.getPermissions(java.security.Principal)

getPermissions

public Permissions getPermissions(Collection principals)
Specified by:
getPermissions in interface org.apache.jetspeed.security.PermissionManager
See Also:
PermissionManager.getPermissions(java.util.Collection)

getPrincipalsFullPath

private Collection getPrincipalsFullPath(Collection principals)

Get the full path for the Principalin the collection.

Parameters:
principals - The collection of principals.
Returns:
The collection of principals names.

appendSecurityPermissions

private Permissions appendSecurityPermissions(Collection omPermissions,
                                              Permissions permissions)

Iterate through a collection of InternalPermissionand build a unique collection of Permission.

Parameters:
omPermissions - The collection of InternalPermission.
Returns:
The collection of Permission.

addPermission

public void addPermission(Permission permission)
                   throws org.apache.jetspeed.security.SecurityException
Specified by:
addPermission in interface org.apache.jetspeed.security.PermissionManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
PermissionManager.addPermission(java.security.Permission)

removePermission

public void removePermission(Permission permission)
                      throws org.apache.jetspeed.security.SecurityException
Specified by:
removePermission in interface org.apache.jetspeed.security.PermissionManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
PermissionManager.removePermission(java.security.Permission)

removePermissions

public void removePermissions(Principal principal)
                       throws org.apache.jetspeed.security.SecurityException
Specified by:
removePermissions in interface org.apache.jetspeed.security.PermissionManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
PermissionManager.removePermissions(java.security.Principal)

grantPermission

public void grantPermission(Principal principal,
                            Permission permission)
                     throws org.apache.jetspeed.security.SecurityException
Specified by:
grantPermission in interface org.apache.jetspeed.security.PermissionManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
PermissionManager.grantPermission(java.security.Principal, java.security.Permission)

permissionExists

public boolean permissionExists(Permission permission)
Specified by:
permissionExists in interface org.apache.jetspeed.security.PermissionManager
See Also:
PermissionManager.permissionExists(java.security.Permission)

revokePermission

public void revokePermission(Principal principal,
                             Permission permission)
                      throws org.apache.jetspeed.security.SecurityException
Specified by:
revokePermission in interface org.apache.jetspeed.security.PermissionManager
Throws:
org.apache.jetspeed.security.SecurityException
See Also:
PermissionManager.revokePermission(java.security.Principal, java.security.Permission)

getInternalPrincipal

org.apache.jetspeed.security.om.InternalPrincipal getInternalPrincipal(String fullPath)

Returns the InternalPrincipalfrom the full path.

Parameters:
fullPath - The full path.
Returns:
The InternalPrincipal.

getInternalPermission

org.apache.jetspeed.security.om.InternalPermission getInternalPermission(Permission permission)

Returns the InternalPermission from a Permission.

Parameters:
permission - The permission.
Returns:
The InternalPermission.


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