!198 BUG修复,权限控制

Merge pull request !198 from dxfeng/feature/dxf
pull/199/MERGE
dxfeng 3 years ago committed by Gitee
commit 924c2cd3b6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -22,21 +22,13 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
private RecordSet grs = new RecordSet();
private static final String COMPANY_RIGHT = "OrgChart:All";
private static final String USER_RIGHT = "OrgPerspective:All";
@Override
public Map<String, Object> getOptionCondition(Map<String, Object> request2Map, User user) {
Map<String, Object> result = new HashMap<>();
RecordSet rs = new RecordSet();
String type = (String) request2Map.get("type");
String rightName = "OrgChart:All";
// 组织透视
if ("user".equals(type)) {
rightName = "OrgPerspective:All";
}
boolean hasRight = HasRightUtil.hasRight(user, rightName, true);
result.put("hasRight", hasRight);
if (!hasRight) {
return result;
}
rs.executeQuery("select id, companyname from HrmCompanyVirtual order by id");
List<Map<String, Object>> fclasslist = new ArrayList<>();
@ -102,6 +94,12 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
@Override
public Map<String, Object> getCompanyData(Map<String, Object> request2Map, User user) {
Map<String, Object> result = new HashMap<>();
boolean hasRight = HasRightUtil.hasRight(user, COMPANY_RIGHT, true);
result.put("hasRight", hasRight);
if (!hasRight) {
return result;
}
String root = (String) request2Map.get("root"); // 根节点
String level = (String) request2Map.get("level"); // 显示层级
@ -140,7 +138,6 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
findCompanyItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true);
}
Map<String, Object> result = new HashMap<>();
result.put("api_status", true);
result.put("data", list);
return result;
@ -205,6 +202,12 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
@Override
public Map<String, Object> getUserData(Map<String, Object> request2Map, User user) {
Map<String, Object> result = new HashMap<>();
boolean hasRight = HasRightUtil.hasRight(user, USER_RIGHT, true);
result.put("hasRight", hasRight);
if (!hasRight) {
return result;
}
String root = (String) request2Map.get("root"); // 根节点
String level = (String) request2Map.get("level"); // 显示层级
if (StringUtils.isBlank(level)) {
@ -249,7 +252,6 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
findUserItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true);
}
Map<String, Object> result = new HashMap<>();
result.put("api_status", true);
result.put("data", list);
return result;

Loading…
Cancel
Save