@Override public boolean isAllowed(final String key, final Map<String, Serializable> context) throws SExecutionException { long userId = getLoggedUserId(sessionAccessor, sessionService); Long processInstanceId = getLongParameter(context, URLAdapterConstants.ID_QUERY_PARAM); if (processInstanceId == null) { throw new IllegalArgumentException( "Parameter 'id' is mandatory to execute Page Authorization rule 'IsProcessInitiatorRule'"); } try { return processInvolvementDelegate.isProcessOrArchivedProcessInitiator(userId, processInstanceId); } catch (ProcessInstanceNotFoundException e) { throw new SExecutionException(e); } }
@Override public boolean isAllowed(final String key, final Map<String, Serializable> context) throws SExecutionException { long userId = getLoggedUserId(sessionAccessor, sessionService); Long processInstanceId = getLongParameter(context, URLAdapterConstants.ID_QUERY_PARAM); if (processInstanceId == null) { throw new IllegalArgumentException( "Parameter 'id' is mandatory to execute Page Authorization rule 'IsProcessInitiatorRule'"); } try { return processInvolvementDelegate.isProcessOrArchivedProcessInitiator(userId, processInstanceId); } catch (ProcessInstanceNotFoundException e) { throw new SExecutionException(e); } }
public boolean isInvolvedInProcessInstance(final long userId, final long processInstanceId) throws ProcessInstanceNotFoundException { final TaskInvolvementDelegate taskInvolvementDelegate = new TaskInvolvementDelegate(); // IS_PROCESS_INITIATOR rule if (isProcessOrArchivedProcessInitiator(userId, processInstanceId)) { return true; } try { // IS_TASK_PERFORMER rule if (taskInvolvementDelegate.isExecutorOfArchivedTaskOfProcess(userId, processInstanceId)) { return true; } } catch (SBonitaReadException e) { throw new RetrieveException(e); } try { // IS_INVOLVED_IN_PROCESS_INSTANCE rule if (taskInvolvementDelegate.hasUserPendingOrAssignedTasks(userId, processInstanceId)) { return true; } } catch (SExecutionException e) { throw new RetrieveException(e); } return false; }
public boolean isInvolvedInProcessInstance(final long userId, final long processInstanceId) throws ProcessInstanceNotFoundException { final TaskInvolvementDelegate taskInvolvementDelegate = new TaskInvolvementDelegate(); // IS_PROCESS_INITIATOR rule if (isProcessOrArchivedProcessInitiator(userId, processInstanceId)) { return true; } try { // IS_TASK_PERFORMER rule if (taskInvolvementDelegate.isExecutorOfArchivedTaskOfProcess(userId, processInstanceId)) { return true; } } catch (SBonitaReadException e) { throw new RetrieveException(e); } try { // IS_INVOLVED_IN_PROCESS_INSTANCE rule if (taskInvolvementDelegate.hasUserPendingOrAssignedTasks(userId, processInstanceId)) { return true; } } catch (SExecutionException e) { throw new RetrieveException(e); } return false; }