|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines an object that is able to resolve the form access permissions for a user or role given a particular node element. Form Access in the Process Manager engine associates forms with specific users and roles at certain steps in the process. These associations are established from the builder by the process designer. This object is the run-time representation of those associations.
Using this object, a developer can determine which form to display to the end-user when the process is positioned at a particular node. They can also check if a particular user has the permission to search the data dictionary.
The object that implements IAccessControlManager
is part of
the application's process definition; a handle to the access control
manager can be obtained via the IProcessDefinition
interface.
IFormElement
,
INodeElement
,
IProcessDefinition
,
IProcessInstance
Method Summary | |
boolean |
areRolesAllowed(INodeElement node,
java.util.Enumeration roleNames,
IFormElement form)
Returns true if any of the given role names is permitted to see the given form from the given node. |
boolean |
canSearch(java.util.Enumeration roleNames)
Returns true if any of the given role names are permitted to search. |
boolean |
canSearch(java.lang.String roleName)
Returns true if the given role name is permitted to search. |
java.util.Enumeration |
getEntryNodes(IParticipant p)
Returns an enumeration of entry point nodes that the given user is allowed to use. |
IFormElement |
getFormElement(INodeElement node,
IParticipant p)
Returns the form element the specified user has access to at the given node element. |
IFormElement |
getFormElement(INodeElement node,
IParticipant p,
IProcessInstance pi)
Returns the form element the specified user has access to at the given node element, given the context of the process instance. |
IFormElement |
getFormElement(INodeElement node,
java.lang.String roleName)
Returns the form element the specified role has access to at the given node element. |
boolean |
isAssigneeAllowed(INodeElement node,
IFormElement form)
Returns true if the assignee role is permitted to see the given form from the given node. |
boolean |
isRoleAllowed(INodeElement node,
java.lang.String roleName,
IFormElement form)
Returns true if the given role is permitted to see the given form from the given node. |
Method Detail |
public IFormElement getFormElement(INodeElement node, java.lang.String roleName) throws PMException
// Determine if the assignee has a view on the form // IAccessControlManager acl = app.getProcessDefinition() .getAccessControlManager(); IFormElement fe = acl.getFormElement( node, IRole.ASSIGNEE ); if( fe == null ) throw new Exception( "Assignee has no view" );
node
- a node elementroleName
- a name of the rolePMException
- if there is no association between the given
role and node with a form.IFormElement
,
INodeElement
public IFormElement getFormElement(INodeElement node, IParticipant p, IProcessInstance pi) throws PMException
// Determine what form should be used for rendering the process // instance data // ICorporateDirectory cd = cluster.getCorporateDirectory(); IParticipant u = cd.getUserById( "joe" ); IAccessControlManager acl = app.getProcessDefinition() .getAccessControlManager(); IFormElement fe = acl.getFormElement( node, u, pi );
node
- a node elementp
- a corporate directory userpi
- the current process instancePMException
- if there is no association between the given
role/node and a form.IFormElement
,
INodeElement
,
IParticipant
,
IProcessInstance
,
IRoleManager.resolveRoles( IParticipant, IProcessInstance )
public IFormElement getFormElement(INodeElement node, IParticipant p) throws PMException
getFormElement( INodeElement, IParticipant,
IProcessInstance )
in that this method should be called where
there is no process instance to establish context, such as at an entry
point node.
The process designer associates forms with specific users and activities at certain steps in the process. This method is the run-time resolution of that design-time association.
// Which form should be used to display this entry point? // ICorporateDirectory cd = cluster.getCorporateDirectory(); IParticipant u = cd.getUserById( "joe" ); IAccessControlManager acl = app.getProcessDefinition() .getAccessControlManager(); IFormElement fe = acl.getFormElement( node, u );
node
- a node elementp
- a corporate directory userPMException
- if there is no association between the given
role/node and a form.IFormElement
,
INodeElement
,
IParticipant
,
IRoleManager.resolveRoles( IParticipant )
public java.util.Enumeration getEntryNodes(IParticipant p) throws PMException
The process designer associates forms with specific users and activities at certain steps in the process. This method is the run-time resolution of that design-time association.
// What are the entry points that this user is allowed to access? // ICorporateDirectory cd = cluster.getCorporateDirectory(); IParticipant u = cd.getUserById( "joe" ); for( Enumeration eps = app.getProcessDefinition() .getAccessControlManager() .getEntryNodes( u ); eps.hasMoreElements(); ) { INodeElement ne = (INodeElement) eps.nextElement(); System.out.println( "entry point: " + ne.getName() ); }
p
- a corporate directory userPMException
- if there is a problem resolving the roles
that the user belongs to.INodeElement
,
IParticipant
public boolean isRoleAllowed(INodeElement node, java.lang.String roleName, IFormElement form) throws PMException
node
- roleName
- form
- true
if the given role is permitted to see
the given form from the given node; false
otherwise.PMException
- if there is no association between the given
role and node with a form.IFormElement
,
INodeElement
public boolean areRolesAllowed(INodeElement node, java.util.Enumeration roleNames, IFormElement form) throws PMException
ICorporateDirectory cd = cluster.getCorporateDirectory(); IParticipant u = cd.getUserById( "joe" ); IProcessDefinition pd = app.getProcessDefinition(); INodeElement en = pd.getProcessMap().getNodeElement( "EntryPoint1" ); IFormElement fe = pd.getFormDictionary() .getFormElement( formName ); // What are the roles of this user? // if( ! pd.getAccessControlManager() .areRolesAllowed( en, pd.getRoleManager().resolveRoles( u ), fe ) ) { System.out.println( "user has no view" ); }
node
- a node elementroleNames
- a list of role namesform
- a form elementtrue
if the any of the given roles are
permitted to see the given form from the given node;
false
otherwise.PMException
- if there is no association between the given
role and node with a form.isRoleAllowed(com.netscape.pm.model.INodeElement, java.lang.String, com.netscape.pm.model.IFormElement)
,
IFormElement
,
INodeElement
public boolean isAssigneeAllowed(INodeElement node, IFormElement form) throws PMException
isRoleAllowed( INodeElement, IRole.ASSIGNEE,
IFormElement )
.node
- a node elementform
- a form elementtrue
if the assignee role is permitted to
see the given form from the given node; false
otherwise.PMException
- if there is no association between the given
role and node with a form.isRoleAllowed(com.netscape.pm.model.INodeElement, java.lang.String, com.netscape.pm.model.IFormElement)
,
IFormElement
,
INodeElement
public boolean canSearch(java.lang.String roleName)
roleName
- a role nametrue
if the given role is permitted to search;
false
otherwise.public boolean canSearch(java.util.Enumeration roleNames)
roleNames
- a list of role namestrue
if any of the given roles are permitted to
search; false
otherwise.canSearch( String )
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |