Products | Versions |
---|---|
TIBCO EBX | All supported versions. |
In this article we will show you how to define dynamic permissions depending on whether we are in a workflow context or not.
In order to achieve this, we will have to implement a programmatic rule AccessRule that we will apply on the concerned node(s) in a data model extension SchemaExtensions.
Please see reference section.
I want my "Products" table to be updatable in a workflow context only.
public void defineExtensions(SchemaExtensionsContext context) { final AccessRule accessRuleOnProducts = new AccessRuleOnProducts(); context.setAccessRuleOnNode(Path.parse( "/root/products" ), accessRuleOnProducts); } |
public AccessPermission getPermission(Adaptation record, Session session, SchemaNode node) { if (session.isInWorkflowInteraction( true )) return AccessPermission.getReadWrite(); else return AccessPermission.getReadOnly(); } |