|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PermissionManager
Describe the interface for managing Permission
and 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>
Method Summary | |
---|---|
void |
addPermission(Permission permission)
Adds a permission definition. |
boolean |
checkPermission(Subject subject,
Permission permission)
Check permission for the given subject's access to the resource protected by the permission This is an abstraction introduced in M4 for Permission Manager implementations NOT founded upon the a Java security policy. |
Collection |
getPermissions()
Retrieve a collection of all Permissions in the system ordered by Permission Type, resource Note that we return a collection of InternalPrincipal |
Permissions |
getPermissions(Collection principals)
Gets the Permissions given a collection of Principal . |
Permissions |
getPermissions(Principal principal)
Gets the Permissions given a Principal . |
Permissions |
getPermissions(String classname,
String resource)
Retrieve a list of all Permissions in the system for a given resource The resource can be a prefix, for example "j2-admin" will retrieve all portlet permissions starting with j2-admin |
Collection |
getPrincipals(Permission permission)
Given a permission, return all principals granted to that permission |
void |
grantPermission(Principal principal,
Permission permission)
Grant a Permission to 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 Permission from a given Principal . |
int |
updatePermission(Permission permission,
Collection principals)
Update the collection of principals on the given principal, appropriately granting or revoking principals to the given permission. |
Method Detail |
---|
Permissions getPermissions(Principal principal)
Gets the Permissions
given a Principal
.
principal
- The principal.
Permissions getPermissions(Collection principals)
Gets the Permissions
given a collection of Principal
.
principals
- A collection of principal.
void addPermission(Permission permission) throws SecurityException
Adds a permission definition.
permission
- The permission to add.
Throws
- a security exception.
SecurityException
void removePermission(Permission permission) throws SecurityException
Remove all instances of a given permission.
permission
- The permission to remove.
Throws
- a security exception.
SecurityException
boolean permissionExists(Permission permission)
Whether the given permission exists.
permission
- The permission to look for.
void removePermissions(Principal principal) throws SecurityException
Remove all permissions for a given principal.
principal
- The principal.
Throws
- a security exception.
SecurityException
void grantPermission(Principal principal, Permission permission) throws SecurityException
Grant a Permission
to a given Principal
.
principal
- The principal.permission
- The permission.
Throws
- a security exception if the principal does not exist.
SecurityException
void revokePermission(Principal principal, Permission permission) throws SecurityException
Revoke a Permission
from a given Principal
.
principal
- The principal.permission
- The permission.
Throws
- a security exception.
SecurityException
boolean checkPermission(Subject subject, Permission permission)
Check permission for the given subject's access to the resource protected by the permission This is an abstraction introduced in M4 for Permission Manager implementations NOT founded upon the a Java security policy.
subject
- The Java subject.permission
- The permission, usually a portlet, page or folder type permission.
Collection getPermissions()
InternalPrincipal
InternalPrincipal
Permissions getPermissions(String classname, String resource)
int updatePermission(Permission permission, Collection principals) throws SecurityException
permission
- Permission to be updatedprincipals
- The new collection of principals based on BasePrincipal
to be associated with this permission
SecurityException
Collection getPrincipals(Permission permission)
permission
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |