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: when rbac enabled is true, not check_dataset_permission (#41022)

wangxiaolei785ca4b915da
diff --git a/api/controllers/console/datasets/datasets.py b/api/controllers/console/datasets/datasets.py
index aedc9cf8940..1fef3e5e739 100644
--- a/api/controllers/console/datasets/datasets.py
+++ b/api/controllers/console/datasets/datasets.py
@@ -668,10 +668,12 @@ class DatasetApi(Resource):
dataset = DatasetService.get_dataset(dataset_id_str, session)
if dataset is None:
raise NotFound("Dataset not found.")
- try:
- DatasetService.check_dataset_permission(dataset, current_user, session)
- except services.errors.account.NoPermissionError as e:
- raise Forbidden(str(e))
+
+ if not dify_config.RBAC_ENABLED:
+ try:
+ DatasetService.check_dataset_permission(dataset, current_user, session)
+ except services.errors.account.NoPermissionError as e:
+ raise Forbidden(str(e))
permissions = enterprise_rbac_service.RBACService.MyPermissions.get(
current_tenant_id,
current_user.id,