Class SecurityUtil
java.lang.Object
com.power4j.fist.boot.security.inner.SecurityUtil
- Since:
- 1.0
- Author:
- CJ (power4j@outlook.com)
-
Constructor Details
-
SecurityUtil
public SecurityUtil()
-
-
Method Details
-
getUser
当前登录用户 -
requireUser
-
getTenantId
当前登录用户的租户ID -
requireTenantId
-
getUsername
当前登录用户的用户名 -
requireUsername
-
getUserId
当前登录用户的ID -
requireUserId
public long requireUserId() -
getRoles
当前登录用户的角色列表,用户会话不存在或者无权限返回空集合 -
act
public static void act(@Nullable UserInfo user, org.apache.commons.lang3.function.FailableRunnable<Exception> runnable) throws com.power4j.coca.kit.common.exception.WrappedException 以用户身份执行业务逻辑- Parameters:
user- 用户runnable- 业务逻辑- Throws:
com.power4j.coca.kit.common.exception.WrappedException
-