dify/api/services/knowledge_fs
Jyong cce0d818cf feat(knowledge-fs): authorize spaces with the legacy dataset RBAC points
KnowledgeFS spaces used their own `knowledge_space_*` RBAC vocabulary, so
workspace roles configured for knowledge bases did not apply to them. Reuse
the legacy `dataset_*` permission points instead, following the mapping the
dataset console already applies:

- read      -> dataset_readonly
- create    -> dataset_create_and_management
- edit / document write -> dataset_edit
- delete    -> dataset_delete
- access config -> dataset_access_config
- query / research / trace detail -> dataset_retrieval_recall

The enterprise `/knowledge-fs/permission-keys/batch` lookup now answers in
that vocabulary and is translated back into the product capabilities the
console exposes as `permission_keys`, so the web stays unchanged; the
historical `knowledge_space_*` keys remain accepted during the transition.
Workspace-level checks send the mapped dataset scene with
`resource_type=dataset`, and the RBAC-disabled fallback grants every dataset
point KnowledgeFS consults.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-03 11:10:04 -04:00
..
__init__.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
app_admission_service.py fix(workflow): stabilize KnowledgeFS retrieval access 2026-08-11 11:51:17 -04:00
app_binding_management.py Fix workflow binding sync session handling 2026-08-09 22:50:44 -04:00
app_execution_capability.py feat(knowledge-fs): add automatic metadata filtering to retrieval node 2026-09-02 02:55:12 -04:00
batch_capability.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
buffered_upload_admission.py perf(knowledge-fs): harden cross-format document ingestion 2026-08-31 07:48:35 -04:00
capability_broker.py refactor(knowledge_fs): replace credential service with dataset API key authorization. Remove the API token feature at the space level for knowledgeFs. 2026-08-26 15:40:18 +08:00
cleanup.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
control_plane_service.py fix(knowledge-fs): persist icon style selection (WTA-2068) 2026-08-17 17:31:25 +08:00
control_space_commands.py feat(knowledge-fs): scope dataset API keys by knowledge base type 2026-09-03 05:59:39 -04:00
control_space_lifecycle.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
control_space_management.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
cutover_runtime_gate.py feat(knowledge-fs): automate greenfield workspace cutover 2026-07-28 09:12:50 -04:00
cutover.py feat(knowledge-fs): automate greenfield workspace cutover 2026-07-28 09:12:50 -04:00
data_facade.py feat(knowledge-fs): keep query images with retrieval test history 2026-09-02 09:17:36 -04:00
download_service.py fix(knowledge-fs): align document download contracts 2026-08-12 11:43:32 +08:00
greenfield_initializer.py feat(knowledge-fs): automate greenfield workspace cutover 2026-07-28 09:12:50 -04:00
initial_source_preview_job.py fix(knowledge-fs): update content handling to use KnowledgeFSCrawlImportPagePayload and add cleanup tests 2026-09-03 21:31:00 +08:00
initial_source_preview.py feat(knowledge-fs): add content handling for initial source preview and cleanup tasks 2026-09-03 21:01:21 +08:00
lifecycle_port.py feat(dataset): support deferred New RAG model setup 2026-07-28 23:19:25 +08:00
lifecycle_readiness.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
lifecycle_remote_http.py feat(dataset): support deferred New RAG model setup 2026-07-28 23:19:25 +08:00
lifecycle_saga.py feat(dataset): support deferred New RAG model setup 2026-07-28 23:19:25 +08:00
membership_changes.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
object_storage.py feat(knowledge): stage document uploads before admission 2026-08-10 10:58:17 -04:00
observability.py Refactor frontend architecture and simplify implementation 2026-07-29 02:30:27 -04:00
orphan_reconciler.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
product_application_service.py fix(knowledge-fs): persist icon style selection (WTA-2068) 2026-08-17 17:31:25 +08:00
product_authorization.py feat(knowledge-fs): authorize spaces with the legacy dataset RBAC points 2026-09-03 11:10:04 -04:00
product_dto.py feat(knowledge-fs): add content handling for initial source preview and cleanup tasks 2026-09-03 21:01:21 +08:00
product_operations.py feat(knowledge-fs): authorize spaces with the legacy dataset RBAC points 2026-09-03 11:10:04 -04:00
product_remote_http.py feat(knowledge-fs): add profile-driven multimodal retrieval 2026-09-02 01:01:57 -04:00
product_remote.py feat(knowledge-fs): add profile-driven multimodal retrieval 2026-09-02 01:01:57 -04:00
product_service.py fix(knowledge-fs): persist icon style selection (WTA-2068) 2026-08-17 17:31:25 +08:00
query_images.py feat(knowledge-fs): keep query images with retrieval test history 2026-09-02 09:17:36 -04:00
remote_images.py fix(knowledge-fs): persist document images across formats 2026-08-26 03:58:04 -04:00
remote_registry.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
revocation_commands.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
revocation_reconciler.py Expand application capabilities and refactor core workflows 2026-07-22 05:09:09 -04:00
runtime.py fix(knowledge-fs): align retrieval test timeout 2026-09-01 13:51:15 -04:00
service_api_authorization.py feat(knowledge-fs): scope dataset API keys by knowledge base type 2026-09-03 05:59:39 -04:00
source_import_commit_service.py fix(knowledge-fs): enhance source import handling and error recovery for remote updates 2026-09-02 18:38:38 +08:00
space_tag_service.py feat(knowledge-fs): update space tag management and improve type annotations 2026-08-13 11:14:52 +08:00
staged_upload_service.py feat(knowledge_fs): expand supported document upload formats 2026-08-25 19:58:15 +08:00