Browse Source

[fix] Can not query exists environments (#10884)

always return empty set
3.1.0-release
Jiajie Zhong 2 years ago committed by GitHub
parent
commit
2d7a48b0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java

7
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java

@ -41,6 +41,7 @@ import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.dao.entity.AccessToken;
import org.apache.dolphinscheduler.dao.entity.AlertGroup;
import org.apache.dolphinscheduler.dao.entity.DataSource;
import org.apache.dolphinscheduler.dao.entity.Environment;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.Queue;
import org.apache.dolphinscheduler.dao.entity.Resource;
@ -344,7 +345,11 @@ public class ResourcePermissionCheckServiceImpl implements ResourcePermissionChe
@Override
public Set<Integer> listAuthorizedResource(int userId, Logger logger) {
return Collections.emptySet();
List<Environment> environments = environmentMapper.queryAllEnvironmentList();
if (environments.isEmpty()) {
return Collections.emptySet();
}
return environments.stream().map(Environment::getId).collect(Collectors.toSet());
}
}

Loading…
Cancel
Save