Granting Execute permission on operation/flow

About this task

BTT allows users to grant Execute permission on an operation or flow to a specific user by providing an empty function checkExecutePermission and let users to override it.

Procedure

  1. Before any execution in an operation or flow, BTT would check the Execute permission inside HtmRequestHandler. So the first step is to derive a class from HtmRequestHandler called MyHtmRequestHandler and register MyHtmRequestHandler in btt.xml as request handler for html channel.
    public class MyHtmRequestHandler extends HtmlRequestHandler {
    //This API is empty and expected to be overriden
    protected Object executeProcessorRequest(ChannelContext channelContext)
  2. Override the function checkExecutePermission.
    protected void checkExecutionPermission(String sessionId, String invokerID,
    			ChannelContext channelContext) throws ACLException {
    	}
    1. Set the Execute Permission by using the following API to access SessionContext which includes the detailed information, such as user ID and operation/flow ID.
      CSSessionHandler.getCurrentContextForSession(SessionID);
    2. Define the throwing exception ACLException to deal with the exceptions or errors. Please refer to Using custom exception in HTML channel for detailed process. In this case, to be specific, users could create an error page named ACLException.jsp and add the following code into preProcessException():
      if(exception instanceof ACLException) setErrorPage("ACLException.jsp")