|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.security.DefaultAccessController
public class DefaultAccessController
A default implementation of AccessController.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultAccessController()
Constructs a new access controller. |
|
| 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. |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultAccessController()
| Method Detail |
|---|
public boolean isProtected()
AccessController
isProtected in interface AccessControllerpublic Enumeration allowedPermissions(String role)
AccessController
allowedPermissions in interface AccessControllerrole - the specified role.
public void setAllowedPermissions(String role,
Permission[] permissions)
AccessController
setAllowedPermissions in interface AccessControllerrole - the specified role.permissions - an array of permissions.
public void addAllowedPermission(String role,
Permission permission)
AccessController
addAllowedPermission in interface AccessControllerrole - the specified role.permission - the allowed permission.public void removeAllowedPermissions(String role)
AccessController
removeAllowedPermissions in interface AccessControllerrole - the specified role.public void clearAllowedPermissions()
AccessController
clearAllowedPermissions in interface AccessControllerpublic Set allowedRoleSet()
AccessController
allowedRoleSet in interface AccessControllerpublic Enumeration deniedPermissions(String role)
AccessController
deniedPermissions in interface AccessControllerrole - the specified role.
public void setDeniedPermissions(String role,
Permission[] permissions)
AccessController
setDeniedPermissions in interface AccessControllerrole - the specified role.permissions - an array of permissions.
public void addDeniedPermission(String role,
Permission permission)
AccessController
addDeniedPermission in interface AccessControllerrole - the specified role.permission - the denied permission.public void removeDeniedPermissions(String role)
AccessController
removeDeniedPermissions in interface AccessControllerrole - the role to be updated.public void clearDeniedPermissions()
AccessController
clearDeniedPermissions in interface AccessControllerpublic Set deniedRoleSet()
AccessController
deniedRoleSet in interface AccessController
public String[] getPermissibleRoles(String resource,
String actions)
AccessControllerIf 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.
getPermissibleRoles in interface AccessControllerresource - the name of the resource to check.actions - the name(s) of actions to access.
public String[] getPermissibleRoles(String resource,
int mask)
AccessControllerIf 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.
getPermissibleRoles in interface AccessControllerresource - the name of the resource to check.mask - a mask of actions to access.
public String[] getPermissibleRoles(Permission permission)
AccessControllerIf 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.
getPermissibleRoles in interface AccessControllerpermission - the permission to be checked for.
public boolean checkPermission(Principal principal,
String resource,
String actions)
AccessController
checkPermission in interface AccessControllerprincipal - the authenticated principal (null = unauthenticated).resource - the name of the resource to check.actions - the name(s) of actions to access.
public boolean checkPermission(Principal principal,
String resource,
int mask)
AccessController
checkPermission in interface AccessControllerprincipal - the authenticated principal (null = unauthenticated).resource - the name of the resource to check.mask - a mask of actions to access.
public boolean checkPermission(Principal principal,
Permission permission)
AccessController
checkPermission in interface AccessControllerprincipal - the authenticated principal (null = unauthenticated).permission - the permission to be checked for.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||