# 优化岗位查询权限
This commit is contained in:
@@ -264,21 +264,14 @@ public class PositionServiceImpl implements PositionService {
|
|||||||
Long platformOrgId = CommonConstants.PLATFORM_ORG_ID;
|
Long platformOrgId = CommonConstants.PLATFORM_ORG_ID;
|
||||||
Long loginOrgId = UserContextHolder.getExistLoginOrgId();
|
Long loginOrgId = UserContextHolder.getExistLoginOrgId();
|
||||||
// 获取配置的邀请机构ID(可能为null)
|
// 获取配置的邀请机构ID(可能为null)
|
||||||
Config orgApplyInviterOrgId = configService.getConfig("org_apply_inviter_org_id", platformOrgId, true);
|
String inviterOrgId = configService.getConfigValue("org_apply_inviter_org_id", platformOrgId, true);
|
||||||
|
|
||||||
// 标记是否需要设置orgId(默认不需要)
|
// 标记是否需要设置orgId(默认不需要)
|
||||||
boolean needSetOrgId = false;
|
boolean needSetOrgId = false;
|
||||||
|
|
||||||
if (orgApplyInviterOrgId != null) {
|
if (inviterOrgId != null && !inviterOrgId.isEmpty()) {
|
||||||
// 配置存在:获取配置值,判断是否为有效非空值
|
// 配置存在且有效:既不是平台机构,也不等于配置机构时才需要设置
|
||||||
String inviterOrgId = orgApplyInviterOrgId.getConfigValue();
|
needSetOrgId = !platformOrgId.equals(loginOrgId) && !inviterOrgId.equals(loginOrgId);
|
||||||
if (inviterOrgId != null && !inviterOrgId.isEmpty()) {
|
|
||||||
// 配置存在且有效:既不是平台机构,也不等于配置机构时才需要设置
|
|
||||||
needSetOrgId = !platformOrgId.equals(loginOrgId) && !inviterOrgId.equals(loginOrgId);
|
|
||||||
} else {
|
|
||||||
// 配置存在但值为空:仅排除平台机构,其余需要设置
|
|
||||||
needSetOrgId = !platformOrgId.equals(loginOrgId);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// 配置不存在:仅排除平台机构,其余需要设置
|
// 配置不存在:仅排除平台机构,其余需要设置
|
||||||
needSetOrgId = !platformOrgId.equals(loginOrgId);
|
needSetOrgId = !platformOrgId.equals(loginOrgId);
|
||||||
|
|||||||
Reference in New Issue
Block a user