|
@@ -1627,6 +1627,10 @@ class DocumentService:
|
|
|
name: str,
|
|
|
batch: str,
|
|
|
):
|
|
|
+ if dataset.edit_auth==1 and account.id!=dataset.created_by:
|
|
|
+ raise ValueError(
|
|
|
+ f"Only the creator can upload documents to this knowledge base."
|
|
|
+ )
|
|
|
if account.current_role == TenantAccountRole.EDITOR or account.dept_id!= dataset.dept_id:
|
|
|
document = Document(
|
|
|
tenant_id=dataset.tenant_id,
|