Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: datasets permission is missing (#7751)

crazywoola3a071b8db98c
diff --git a/api/services/dataset_service.py b/api/services/dataset_service.py
index 8649d0fea5f..ce5fa632dcf 100644
--- a/api/services/dataset_service.py
+++ b/api/services/dataset_service.py
@@ -136,7 +136,9 @@ class DatasetService:
return datasets.items, datasets.total
@staticmethod
- def create_empty_dataset(tenant_id: str, name: str, indexing_technique: Optional[str], account: Account):
+ def create_empty_dataset(
+ tenant_id: str, name: str, indexing_technique: Optional[str], account: Account, permission: Optional[str]
+ ):
# check if dataset name already exists
if Dataset.query.filter_by(name=name, tenant_id=tenant_id).first():
raise DatasetNameDuplicateError(f"Dataset with name {name} already exists.")
@@ -153,6 +155,7 @@ class DatasetService:
dataset.tenant_id = tenant_id
dataset.embedding_model_provider = embedding_model.provider if embedding_model else None
dataset.embedding_model = embedding_model.model if embedding_model else None
+ dataset.permission = permission if permission else DatasetPermissionEnum.ONLY_ME
db.session.add(dataset)
db.session.commit()
return dataset