dify/api/controllers/console/datasets
kota-maeda0708 c232375fd2 feat: add visibility control for plugin datasource credentials
Plugin-based datasource credentials (Notion, Jina, Firecrawl, etc.) were
implicitly shared with every workspace member. PR #35468 added the
visibility column, creator tracking and read-side filtering for datasource
providers, but left no way to actually set or change a credential's scope,
so every datasource credential stayed effectively all_team_members.

This completes the datasource side:

Backend:
- add_datasource_api_key_provider / add_datasource_oauth_provider accept
  user_id and visibility; API keys default to all_team_members, OAuth
  defaults to only_me (matching the plugin-credential philosophy)
- new update_datasource_credential_visibility (+ console endpoint) so the
  creator can switch between only_me / all_team_members / partial_members;
  only the creator (or legacy NULL-owner rows) may change the scope
- replace_partial_member_list / clear_partial_member_list helpers on
  CredentialPermissionService (caller owns the transaction)
- list_datasource_credentials returns visibility, user_id, is_editable and
  partial_member_list

Frontend:
- VisibilityModal reusing PermissionSelector, with an empty-partial-members
  guard (the backend rejects an empty list)
- "Who can use" action in the credential operator, gated on is_editable
- scope badges (only me / partial team members) on the credential item

Existing credentials keep working: the visibility column defaults to
all_team_members and legacy rows with a NULL owner are always visible.
2026-06-25 00:00:40 +09:00
..
rag_pipeline feat: add visibility control for plugin datasource credentials 2026-06-25 00:00:40 +09:00
data_source.py feat: RBAC (#37107) 2026-06-18 16:35:29 +00:00
datasets_document.py feat: RBAC (#37107) 2026-06-18 16:35:29 +00:00
datasets_segments.py feat: RBAC (#37107) 2026-06-18 16:35:29 +00:00
datasets.py feat: RBAC (#37107) 2026-06-18 16:35:29 +00:00
error.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
external.py refactor: pass session into hit testing service (#37785) 2026-06-23 06:21:38 +00:00
hit_testing_base.py refactor: pass session into hit testing service (#37785) 2026-06-23 06:21:38 +00:00
hit_testing.py feat: RBAC (#37107) 2026-06-18 16:35:29 +00:00
metadata.py refactor: for db.session feedback service.export feedbacks (#37763) 2026-06-23 14:01:40 +00:00
website.py refactor: fix OpenAPI contract generation schemas (#37387) 2026-06-12 14:25:53 +00:00
wraps.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00