org.apache.jetspeed.security
Interface PermissionManager


public interface PermissionManager

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

The permission manager does not enforce any hierarchy resolution, all relevant principals must be passed to the permission manager to assess the proper permissions.

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>

Method Summary
 void addPermission(Permission permission)
           Adds a permission definition.
 Permissions getPermissions(Collection principals)
           Gets the Permissionsgiven a collection of Principal.
 Permissions getPermissions(Principal principal)
           Gets the Permissionsgiven a Principal.
 void grantPermission(Principal principal, Permission permission)
           Grant a Permissionto a given Principal.
 boolean permissionExists(Permission permission)
           Whether the given permission exists.
 void removePermission(Permission permission)
           Remove all instances of a given permission.
 void removePermissions(Principal principal)
           Remove all permissions for a given principal.
 void revokePermission(Principal principal, Permission permission)
           Revoke a Permissionfrom a given Principal.
 

Method Detail

getPermissions

public Permissions getPermissions(Principal principal)

Gets the Permissionsgiven a Principal.

Parameters:
principal - The principal.
Returns:
The permissions.

getPermissions

public Permissions getPermissions(Collection principals)

Gets the Permissionsgiven a collection of Principal.

Parameters:
principals - A collection of principal.
Returns:
The permissions.

addPermission

public void addPermission(Permission permission)
                   throws SecurityException

Adds a permission definition.

Parameters:
permission - The permission to add.
Throws:
Throws - a security exception.
SecurityException

removePermission

public void removePermission(Permission permission)
                      throws SecurityException

Remove all instances of a given permission.

Parameters:
permission - The permission to remove.
Throws:
Throws - a security exception.
SecurityException

permissionExists

public boolean permissionExists(Permission permission)

Whether the given permission exists.

Parameters:
permission - The permission to look for.
Returns:
Whether the permission exists.

removePermissions

public void removePermissions(Principal principal)
                       throws SecurityException

Remove all permissions for a given principal.

Parameters:
principal - The principal.
Throws:
Throws - a security exception.
SecurityException

grantPermission

public void grantPermission(Principal principal,
                            Permission permission)
                     throws SecurityException

Grant a Permissionto a given Principal.

Parameters:
principal - The principal.
permission - The permission.
Throws:
Throws - a security exception if the principal does not exist.
SecurityException

revokePermission

public void revokePermission(Principal principal,
                             Permission permission)
                      throws SecurityException

Revoke a Permissionfrom a given Principal.

Parameters:
principal - The principal.
permission - The permission.
Throws:
Throws - a security exception.
SecurityException


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