Package com.axelor.auth
Class AuthUtils
java.lang.Object
com.axelor.auth.AuthUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic User
For internal use only.static org.apache.shiro.subject.Subject
static User
getUser()
Retrieves the current user associated with the thread or session.static User
static boolean
static boolean
static boolean
static boolean
isTechnicalStaff
(User user) static void
For internal use only.static void
setCurrentUser
(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
-