dify/api/controllers/console
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
..
agent feat(agent): copy roster agent into workflow inline agent (#37813) 2026-06-23 12:28:29 +00:00
app chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
auth chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
billing refactor: fix OpenAPI contract generation schemas (#37387) 2026-06-12 14:25:53 +00:00
datasets feat: add visibility control for plugin datasource credentials 2026-06-25 00:00:40 +09:00
explore chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
snippets fix: snippet history detail includes input fields (#37797) 2026-06-23 08:08:12 +00:00
socketio chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
tag chore: example of make db.session pass from parameter. (#37561) 2026-06-18 02:16:09 +00:00
workspace feat: filter dataset operator and add miss permission key (#37867) 2026-06-24 09:56:28 +00:00
__init__.py feat: RBAC (#37107) 2026-06-18 16:35:29 +00:00
admin.py chore: remove obsolete admin console routes (#35637) 2026-05-13 08:08:50 +00:00
apikey.py feat: RBAC (#37107) 2026-06-18 16:35:29 +00:00
error.py Restructure the File errors in controller (#23801) 2025-08-13 17:06:07 +08:00
extension.py refactor: accept db.session explicitly in APIBasedExtensionService (#37693) 2026-06-21 00:53:36 +00:00
feature.py refactor(api): migrate remaining console APIs to use injected user/tenant (#37288) 2026-06-11 01:30:31 +00:00
files.py refactor(api): migrate console tags to tenant/user via DI and improve tests (#36658) 2026-05-26 08:20:10 +00:00
human_input_form.py refactor: fix OpenAPI contract generation schemas (#37387) 2026-06-12 14:25:53 +00:00
init_validate.py chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
notification.py refactor: fix OpenAPI contract generation schemas (#37387) 2026-06-12 14:25:53 +00:00
ping.py feat: init fastopenapi (#30453) 2026-01-23 21:07:52 +09:00
remote_files.py fix(api): centralize remote file retrieval (#36399) 2026-06-01 09:25:08 +00:00
setup.py chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
spec.py refactor: fix OpenAPI contract generation schemas (#37387) 2026-06-12 14:25:53 +00:00
version.py refactor: api/controllers/console/version.py to v3 (#31463) 2026-01-26 15:04:25 +08:00
wraps.py feat: RBAC (#37107) 2026-06-18 16:35:29 +00:00