org.apache.jetspeed.security.impl
Class RdbmsPolicy

java.lang.Object
  extended by java.security.Policy
      extended by org.apache.jetspeed.security.impl.RdbmsPolicy

public class RdbmsPolicy
extends Policy

Policy implementation using a relational database as persistent datastore.

This code was partially inspired from articles from:

Author:
David Le Strat

Field Summary
private static org.apache.commons.logging.Log log
           
private  org.apache.jetspeed.security.PermissionManager pms
           InternalPermission Manager Service.
 
Constructor Summary
RdbmsPolicy(org.apache.jetspeed.security.PermissionManager pms)
           Default constructor.
 
Method Summary
private  PermissionCollection getOtherPoliciesPermissions(CodeSource codeSource)
           Gets all the permissions that should be enforced through the other policies configured.
 PermissionCollection getPermissions(CodeSource codeSource)
           The RdbmsPolicy does not protect code source per say, but will return the protected code source from the other configured policies.
 PermissionCollection getPermissions(ProtectionDomain domain)
           
 boolean implies(ProtectionDomain protectionDomain, Permission permission)
           Check that the permission is implied for the protection domain.
 void refresh()
           
 
Methods inherited from class java.security.Policy
getPolicy, setPolicy
 
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

pms

private org.apache.jetspeed.security.PermissionManager pms

InternalPermission Manager Service.

Constructor Detail

RdbmsPolicy

public RdbmsPolicy(org.apache.jetspeed.security.PermissionManager pms)

Default constructor.

Method Detail

refresh

public void refresh()
Specified by:
refresh in class Policy
See Also:
Policy.refresh()

implies

public boolean implies(ProtectionDomain protectionDomain,
                       Permission permission)

Check that the permission is implied for the protection domain. This will check for permissions against the configured RDBMS and all SecurityPolicies configured through the AuthorizationProvider.

The default policy is by default part of the SecurityPolicies and will only if configured through assembly.

Overrides:
implies in class Policy
See Also:
Policy.implies(java.security.ProtectionDomain, java.security.Permission)

getPermissions

public PermissionCollection getPermissions(ProtectionDomain domain)
Overrides:
getPermissions in class Policy
See Also:
Policy.getPermissions(java.security.ProtectionDomain)

getPermissions

public PermissionCollection getPermissions(CodeSource codeSource)

The RdbmsPolicy does not protect code source per say, but will return the protected code source from the other configured policies.

Specified by:
getPermissions in class Policy
See Also:
Policy.getPermissions(java.security.CodeSource)

getOtherPoliciesPermissions

private PermissionCollection getOtherPoliciesPermissions(CodeSource codeSource)

Gets all the permissions that should be enforced through the other policies configured.

Parameters:
codeSource - The CodeSource.
Returns:
A collection of permissions as a PermissionCollection


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