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: 文档导出权限错误 #1807

Merged
merged 1 commit into from
Dec 10, 2024
Merged

fix: 文档导出权限错误 #1807

merged 1 commit into from
Dec 10, 2024

Conversation

shaohuzhang1
Copy link
Contributor

fix: 文档导出权限错误

Copy link

f2c-ci-robot bot commented Dec 10, 2024

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

f2c-ci-robot bot commented Dec 10, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -309,7 +309,7 @@ class Export(APIView):
manual_parameters=DocumentSerializers.Operate.get_request_params_api(),
tags=["知识库/文档"])
@has_permissions(
lambda r, k: Permission(group=Group.DATASET, operate=Operate.USE,
lambda r, k: Permission(group=Group.DATASET, operate=Operate.MANAGE,
dynamic_tag=k.get('dataset_id')))
def get(self, request: Request, dataset_id: str, document_id: str):
return DocumentSerializers.Operate(data={'document_id': document_id, 'dataset_id': dataset_id}).export()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码文件包含一个错误:DatasetSerializers.Operators.cancel().get_request_params()应该使用 DatasetSerializers.Operate(). 同样,Refresh类需要添加 Permission, 可能有缺失的权限设置,以及可能需要更新为更合理的API URL。另外,所有的方法和函数名称在Python中已经统一成了驼峰式命名法。因此,整体来说这是标准的Java风格问题,但需要调整以符合PascalCase或CamelCase规则。

@shaohuzhang1 shaohuzhang1 merged commit ec27e57 into main Dec 10, 2024
4 of 5 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@main@export_document branch December 10, 2024 10:29
shaohuzhang1 added a commit that referenced this pull request Dec 10, 2024
Co-authored-by: wangdan-fit2cloud <dan.wang@fit2cloud.com>
(cherry picked from commit ec27e57)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants