Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: getudffuction 权限问题修复 #691

Merged
merged 2 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1450,9 +1450,12 @@ public Message getRegisterFunctions(HttpServletRequest req, @RequestParam("path"
|| StringUtils.endsWithIgnoreCase(path, Constants.FILE_EXTENSION_SCALA)) {
if (StringUtils.startsWithIgnoreCase(path, StorageUtils$.MODULE$.FILE_SCHEMA())) {
try {
// 获取登录用户
String userName = ModuleUserUtils.getOperationUser(req, "get-register-functions");

FsPath fsPath = new FsPath(path);
// 获取文件系统实例
FileSystem fileSystem = (FileSystem) FSFactory.getFs(fsPath);
FileSystem fileSystem = (FileSystem) FSFactory.getFsByProxyUser(fsPath, userName);
fileSystem.init(null);
if (fileSystem.canRead(fsPath)) {
return Message.ok()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,14 @@ public static List<String> extractPythonMethodNames(String udfPath) throws Excep
String exec =
Utils.exec(
(new String[] {
"sudo",
Constants.PYTHON_COMMAND.getValue(),
Configuration.getLinkisHome() + "/admin/" + "linkis_udf_get_python_methods.py",
localPath
}));
logger.info(
"execute python script to get python method name...{} {} {}",
"execute python script to get python method name...{} {} {} {}",
"sudo",
Constants.PYTHON_COMMAND.getValue(),
Configuration.getLinkisHome() + "/admin/" + "linkis_udf_get_python_methods.py",
localPath);
Expand Down
Loading