Przeglądaj źródła

补充超管角色判断

tags/24080901
WendyYang 1 rok temu
rodzic
commit
809aa6de6f
1 zmienionych plików z 5 dodań i 2 usunięć
  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 Wyświetl plik

@@ -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()));
}

}

Ładowanie…
Anuluj
Zapisz