修改:根据权限返回参数
This commit is contained in:
parent
f8155e1c1f
commit
c16633143e
@ -22,36 +22,9 @@ public class UserPermissionGetter {
|
||||
@Resource
|
||||
private RuntimeAppContextService runtimeAppContextService;
|
||||
|
||||
// 获取子系统权限
|
||||
public List<String> getSubsystemPermissions() {
|
||||
// String currentUserId = runtimeAppContextService.getCurrentUserId();
|
||||
String currentUserId = "zjh";
|
||||
Set<String> result = new HashSet<>();
|
||||
try {
|
||||
// 获取用户权限
|
||||
result = modelRoleService.selectPersByUser(currentUserId)
|
||||
.stream().map(MenuParamView::getSubsystem).collect(Collectors.toSet());
|
||||
// 获取用户所在部门权限
|
||||
List<String> deptIds = businessDatabase.getBusinessDatabase()
|
||||
.eq("user_id", currentUserId).doQuery(XdapDeptUsers.class)
|
||||
.stream().map(XdapDeptUsers::getDepartmentId).collect(Collectors.toList());
|
||||
for (String deptId : deptIds) {
|
||||
Set<String> deptPermissions = modelRoleService.selectPersByUser(deptId)
|
||||
.stream().map(MenuParamView::getSubsystem).collect(Collectors.toSet());
|
||||
result.addAll(deptPermissions);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return new ArrayList<>(result);
|
||||
}
|
||||
|
||||
// 获取子系统下的参数权限
|
||||
public List<String> getParamPermissions(String subsystem) {
|
||||
// String currentUserId = runtimeAppContextService.getCurrentUserId();
|
||||
String currentUserId = "zjh";
|
||||
String currentUserId = runtimeAppContextService.getCurrentUserId();
|
||||
Set<String> result = new HashSet<>();
|
||||
try {
|
||||
// 获取用户权限
|
||||
@ -81,8 +54,7 @@ public class UserPermissionGetter {
|
||||
|
||||
// 获取全部参数权限
|
||||
public List<String> getParamPermissions() {
|
||||
// String currentUserId = runtimeAppContextService.getCurrentUserId();
|
||||
String currentUserId = "zjh";
|
||||
String currentUserId = runtimeAppContextService.getCurrentUserId();
|
||||
Set<String> result = new HashSet<>();
|
||||
try {
|
||||
// 获取用户权限
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user