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