/** * Get the {@link ApplicationUser} executing this condition. * * @param transientVars workflow context - parameters passed to workflow engine * @param args workflow's function arguments * @return The ApplicationUser, or null if run anonymously. */ public static ApplicationUser getCallerUserFromArgs(Map transientVars, Map args) { return getUserByKey(getCallerKey(transientVars, args)); }
/** * Get the {@link ApplicationUser} executing this condition. * * @param transientVars workflow context - parameters passed to workflow engine * @param args workflow's function arguments * @return The ApplicationUser, or null if run anonymously. */ protected ApplicationUser getCallerUser(Map transientVars, Map args) { return getUserByKey(getCallerKey(transientVars, args)); }
private Workflow getWorkflowObject(WorkflowProgressAware from) { // Allows actions to be run as other users. String userkey = WorkflowFunctionUtils.getCallerKey(null, from.getAdditionalInputs()); if (userkey == null && ActionContext.getPrincipal() != null) { ApplicationUser principal = getUserManager().getUserByName(ActionContext.getPrincipal().getName()); userkey = principal == null ? null : principal.getKey(); } if (userkey == null) { userkey = ApplicationUsers.getKeyFor(from.getRemoteApplicationUser()); } return makeWorkflow(ApplicationUsers.byKey(userkey)); }