瀏覽代碼

补充超管角色判断

master
WendyYang 1 年之前
父節點
當前提交
809aa6de6f
共有 1 個檔案被更改,包括 5 行新增2 行删除
  1. +5
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/PermissionCheckHelper.java

+ 5
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/PermissionCheckHelper.java 查看文件

@@ -1,5 +1,8 @@
package com.ningdatech.pmapi.expert.helper;

import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@@ -13,8 +16,8 @@ import org.springframework.stereotype.Component;
public class PermissionCheckHelper {

public boolean isSuperAdmin() {
// TODO
return false;
UserInfoDetails details = LoginUserUtil.loginUserDetail();
return details.getUserRoleList().stream().anyMatch(w -> w.getCode().equals(RoleEnum.SUPER_ADMIN.name()));
}

}

Loading…
取消
儲存