|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AccessController
An interface to objects controlling resources protected by permissions allowing access for specific principals only.
| Method Summary | |
|---|---|
void |
addAllowedPermission(String role,
Permission permission)
Adds an allowed permission for a specified role. |
void |
addDeniedPermission(String role,
Permission permission)
Adds a denied permission for a specified role. |
Enumeration |
allowedPermissions(String role)
Returns an enumeration of allowed permissions for a specified role. |
Set |
allowedRoleSet()
Returns a read-only set of roles with allowed permissions. |
boolean |
checkPermission(Principal principal,
Permission permission)
Checks whether or not the specified principal has the specified permission. |
boolean |
checkPermission(Principal principal,
String resource,
int mask)
Checks whether or not the specified principal has a permission to access the masked actions of the specified resource. |
boolean |
checkPermission(Principal principal,
String resource,
String actions)
Checks whether or not the specified principal has a permission to access the named actions of the specified resource. |
void |
clearAllowedPermissions()
Clears all allowed permissions. |
void |
clearDeniedPermissions()
Clears all denied permissions. |
Enumeration |
deniedPermissions(String role)
Returns an enumeration of denied permissions for a specified role. |
Set |
deniedRoleSet()
Returns a read only set of roles with denied permissions. |
String[] |
getPermissibleRoles(Permission permission)
Gets the roles having the specified permission. |
String[] |
getPermissibleRoles(String resource,
int mask)
Gets the roles having a permission to access the masked actions of the specified resource. |
String[] |
getPermissibleRoles(String resource,
String actions)
Gets the roles having a permission to access the named actions of the specified resource. |
boolean |
isProtected()
Checks whether the access controller is protected by any allowed or denied permissions. |
void |
removeAllowedPermissions(String role)
Removes allowed permissions for a specified role. |
void |
removeDeniedPermissions(String role)
Removes denied permissions for a specified role. |
void |
setAllowedPermissions(String role,
Permission[] permissions)
Sets allowed permissions for a specified role. |
void |
setDeniedPermissions(String role,
Permission[] permissions)
Sets denied permissions for a specified role. |
| Method Detail |
|---|
boolean isProtected()
Enumeration allowedPermissions(String role)
role - the specified role.
void setAllowedPermissions(String role,
Permission[] permissions)
role - the specified role.permissions - an array of permissions.
void addAllowedPermission(String role,
Permission permission)
role - the specified role.permission - the allowed permission.void removeAllowedPermissions(String role)
role - the specified role.void clearAllowedPermissions()
Set allowedRoleSet()
Enumeration deniedPermissions(String role)
role - the specified role.
void setDeniedPermissions(String role,
Permission[] permissions)
role - the specified role.permissions - an array of permissions.
void addDeniedPermission(String role,
Permission permission)
role - the specified role.permission - the denied permission.void removeDeniedPermissions(String role)
role - the role to be updated.void clearDeniedPermissions()
Set deniedRoleSet()
String[] getPermissibleRoles(String resource,
String actions)
If the access controller is not protected by any permissions, null is returned. If there are not any roles having the requested permission, an empty array is returned.
resource - the name of the resource to check.actions - the name(s) of actions to access.
SecurityException - if the access control list is invalid.
String[] getPermissibleRoles(String resource,
int mask)
If the access controller is not protected by any permissions, null is returned. If there are not any roles having the requested permission, an empty array is returned.
resource - the name of the resource to check.mask - a mask of actions to access.
SecurityException - if the access control list is invalid.String[] getPermissibleRoles(Permission permission)
If the access controller is not protected by any permissions, null is returned. If there are not any roles having the requested permission, an empty array is returned.
permission - the permission to be checked for.
SecurityException - if the access control list is invalid.
boolean checkPermission(Principal principal,
String resource,
String actions)
principal - the authenticated principal (null = unauthenticated).resource - the name of the resource to check.actions - the name(s) of actions to access.
SecurityException - if the access control list is invalid.
boolean checkPermission(Principal principal,
String resource,
int mask)
principal - the authenticated principal (null = unauthenticated).resource - the name of the resource to check.mask - a mask of actions to access.
SecurityException - if the access control list is invalid.
boolean checkPermission(Principal principal,
Permission permission)
principal - the authenticated principal (null = unauthenticated).permission - the permission to be checked for.
SecurityException - if the access control list is invalid.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||