Browse Source

增加序列化ID

master
WendyYang 1 year ago
parent
commit
99c4cbade9
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java

+ 9
- 6
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java View File

@@ -25,6 +25,8 @@ import java.util.stream.Collectors;
@EqualsAndHashCode(callSuper = true)
public class UserInfoDetails extends AbstractLoginUser implements UserDetails {

private static final long serialVersionUID = -8219907690673456440L;

private String realName;

private String password;
@@ -104,21 +106,22 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails {

/**
* 取最高的权限
*
* @return
*/
public RoleEnum getRoleCode(){
if(CollUtil.isNotEmpty(this.userRoleList)){
public RoleEnum getRoleCode() {
if (CollUtil.isNotEmpty(this.userRoleList)) {
return RoleEnum.checkHigherRole(this.userRoleList.stream()
.map(Role::getCode).collect(Collectors.toList()));
}
return null;
}

public Boolean getIsOrgAdmin(){
if(CollUtil.isNotEmpty(this.userRoleList)){
for(Role role : this.userRoleList){
public Boolean getIsOrgAdmin() {
if (CollUtil.isNotEmpty(this.userRoleList)) {
for (Role role : this.userRoleList) {
RoleEnum roleEnum = RoleEnum.mathByName(role.getCode());
if(Objects.nonNull(roleEnum) && roleEnum.eq(RoleEnum.COMPANY_MANAGER.name())){
if (Objects.nonNull(roleEnum) && roleEnum.eq(RoleEnum.COMPANY_MANAGER.name())) {
return Boolean.TRUE;
}
}


Loading…
Cancel
Save