Package com.axelor.auth
Class AuthUtils
java.lang.Object
com.axelor.auth.AuthUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UserFor internal use only.static org.apache.shiro.subject.Subjectstatic UsergetUser()Retrieves the current user associated with the thread or session.static Userstatic booleanstatic booleanstatic booleanstatic booleanisTechnicalStaff(User user) static voidFor internal use only.static voidsetCurrentUser(User user) For internal use only.
-
Constructor Details
-
AuthUtils
public AuthUtils()
-
-
Method Details
-
setCurrentUser
For internal use only. -
getCurrentUser
For internal use only. -
removeCurrentUser
public static void removeCurrentUser()For internal use only. -
getSubject
public static org.apache.shiro.subject.Subject getSubject() -
getUser
Retrieves the current user associated with the thread or session.It first uses the current user stored in the thread-local (set for batch / audit purpose) if provided. Else it attempts to retrieve the user based on the principal associated with the current subject
- Returns:
- the current user if available; otherwise null
-
getUser
-
isActive
-
isAdmin
-
isTechnicalStaff
-
hasRole
-