Browse Source

补充超管角色判断

master
WendyYang 1 year ago
parent
commit
809aa6de6f
1 changed files with 5 additions and 2 deletions
  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 View File

@@ -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…
Cancel
Save