|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.ejb.PolicyManager
A class which extends this class is capable of moderating the access to a resource. Roles and targets are created at development time and may not change during the course of execution.
Inner Class Summary | |
class |
PolicyManager.Role
Represents a role for a user and has the targets that the role has access to. |
Constructor Summary | |
PolicyManager(ObjectProperties props)
Constructor. |
Method Summary | |
boolean |
checkAccess(java.lang.String sUsername,
int iRolesMask,
IOwnedTarget ownedTarget,
int iTarget)
Checks access by role and owner. |
boolean |
checkOwnerAccess(java.lang.String sUsername,
IOwnedTarget ownedTarget)
Checks if the specified user owns the specified target. |
boolean |
checkRoleAccess(int iRole,
int iTarget)
Checks if a role has access to a target. |
boolean |
checkRolesMask(int iRolesMask,
int iRoleNumber)
Checks if any of the roles listed in the specified mask are the provided role number. |
boolean |
checkRolesMaskAccess(int iRolesMask,
int iTarget)
Checks if any of the roles listed in the specified mask have access to a target. |
static int |
getMaskFromRoles(int[] roles)
Gets a roles mask from a list of roles. |
PolicyManager.Role |
getRoleByRoleNumber(int iRoleNumber)
Gets the role by role number. |
int |
getRoleNumberByName(java.lang.String sRoleName)
Gets a role number by its name. |
PolicyManager.Role[] |
getRoles()
Gets the available roles. |
int[] |
getRolesFromMask(int iRolesMask)
Gets a list of roles from a roles mask. |
int |
getTargetNumberByName(java.lang.String sTargetName)
Gets a target number by its name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PolicyManager(ObjectProperties props)
props
- the object propoertiesMethod Detail |
public boolean checkOwnerAccess(java.lang.String sUsername, IOwnedTarget ownedTarget)
sUsername
- the usernameownedTarget
- the owned targetpublic boolean checkAccess(java.lang.String sUsername, int iRolesMask, IOwnedTarget ownedTarget, int iTarget)
sUsername
- the usernameiRolesMask
- the roles maskownedTarget
- the owned targetiTarget
- the given targetpublic boolean checkRoleAccess(int iRole, int iTarget)
iRoles
- the role numberiTarget
- the given targetpublic boolean checkRolesMaskAccess(int iRolesMask, int iTarget)
iRolesMask
- the role maskiTarget
- the given targetpublic boolean checkRolesMask(int iRolesMask, int iRoleNumber)
iRolesMask
- the role maskiRoleNumber
- the role numberpublic int[] getRolesFromMask(int iRolesMask)
iRolesMask
- the role maskpublic static int getMaskFromRoles(int[] roles)
roles
- the list of rolespublic int getRoleNumberByName(java.lang.String sRoleName)
sRoleName
- the role namejava.lang.IllegalArgumentException
- if role name is not foundpublic int getTargetNumberByName(java.lang.String sTargetName)
sTargetName
- the target namejava.lang.IllegalArgumentException
- if target name is not foundpublic PolicyManager.Role[] getRoles()
public PolicyManager.Role getRoleByRoleNumber(int iRoleNumber)
iRoleNumber
- the role numbernull
if does not exist
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |