Description

  • org.joget.workflow.model.service.WorkflowUserManager
  • Under wflow-directory module
  • Utility methods to deal with logged in user

Code Sample

import org.joget.apps.app.service.AppUtil;
import org.joget.workflow.model.service.WorkflowUserManager;
 
WorkflowUserManager workflowUserManager = (WorkflowUserManager) AppUtil.getApplicationContext().getBean("workflowUserManager");
String username = workflowUserManager.getCurrentUsername();

Fields

ROLE_ANONYMOUS
public static final java.lang.String ROLE_ANONYMOUS = "anonymousUser";

Username of an anonymous user

ROLE_ADMIN
public static final java.lang.String ROLE_ADMIN = "ROLE_ADMIN";

Role key of admin

Methods

clearCurrentThreadUser
public void clearCurrentThreadUser()

Method used by system to clear the user 

getCurrentThreadUser
public java.lang.String getCurrentThreadUser()

Method used by system to get current thread user

getCurrentRoles
public java.util.Collection<java.lang.String> getCurrentRoles()

Retrieve the roles of current logged in user 

getCurrentUsername
public java.lang.String getCurrentUsername()

Gets current logged in user

isCurrentUserAnonymous
public boolean isCurrentUserAnonymous()

Check whether the current user is an anonymous

isCurrentUserInRole
public boolean isCurrentUserInRole(java.lang.String role)

Check current user has a role

isSystemUser
public boolean isSystemUser()

Check the current processing is triggered by system

setCurrentThreadUser
public void setSystemThreadUser(boolean isSystemUser)

Set the current processing is trigger by system

setSystemThreadUser
public void setCurrentThreadUser(java.lang.String username)

Method used by system to set current logged in user

 

  • No labels