Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
301 commits
Select commit Hold shift + click to select a range
aa2dbe9
chore(deps-dev): bump the dev group in /api with 5 updates (#35581)
dependabot[bot] Apr 27, 2026
d02a36e
chore(deps): bump psycopg2-binary from 2.9.11 to 2.9.12 in /api in th…
dependabot[bot] Apr 27, 2026
0519bc0
chore(deps): bump the opentelemetry group in /api with 7 updates (#35…
dependabot[bot] Apr 27, 2026
4f42753
chore(deps-dev): bump xinference-client from 2.5.0 to 2.7.0 in /api i…
dependabot[bot] Apr 27, 2026
ffee3b4
chore(deps): bump the storage group across 1 directory with 3 updates…
dependabot[bot] Apr 27, 2026
554e57c
chore(ci): increase tsslint heap limit (#35591)
lyzno1 Apr 27, 2026
3526afc
refactor(web): migrate simple overlay tooltips (#35588)
lyzno1 Apr 27, 2026
e7f8a9f
fix(web): migrate variable type selector overlay (#35590)
hjlarry Apr 27, 2026
dffb26e
fix: improve variable picker text width allocation (#35587)
hjlarry Apr 27, 2026
1a4671b
ci: upgrade web test runners (#35593)
lyzno1 Apr 27, 2026
451cc7b
fix: enhance file uploader with billing support and update translatio…
WTW0313 Apr 27, 2026
28ee677
fix: school name can not input (#35597)
iamjoel Apr 27, 2026
03644a7
chore: update dependency catalog (#35594)
lyzno1 Apr 27, 2026
e22b037
chore(i18n): sync translations with en-US (#35595)
github-actions[bot] Apr 27, 2026
e73f720
fix: keep cleanup tasks resilient to billing API failures (#35600)
zyssyz123 Apr 27, 2026
0e15766
fix: download and upload package before invoking upgrade in auto-upgr…
BenjaminX Apr 27, 2026
7e093c3
refactor: move SegmentAttachmentBinding and UploadFile to TypeBase (#…
asukaminato0721 Apr 27, 2026
b789f82
test: add Baidu OBS storage unit tests (#34330)
jimmyzhuu Apr 28, 2026
49dea08
fix: show full checklist message tooltip instead of truncated (#35613)
hjlarry Apr 28, 2026
4c863d4
fix: align auto update time picker to the right (#35621)
hjlarry Apr 28, 2026
d0955ac
fix(test): register baidu_obs mock as pytest plugin (#35618)
lin-snow Apr 28, 2026
1a1d3b1
fix: align object value remove button of chat variable (#35616)
hjlarry Apr 28, 2026
5ad05cf
fix: prioritize URL conversation_id over localStorage in embedded cha…
treekimm Apr 28, 2026
ea47036
refactor(web): improve a11y and design-system consistency for date/ti…
lyzno1 Apr 28, 2026
deb97c4
refactor: improve scrollbar handling in plugin and model selector UI …
lyzno1 Apr 28, 2026
0e0a78c
test: cover shared workflow app run (#35634)
lyzno1 Apr 28, 2026
bfee04b
fix(ci): wait for mysql to accept queries before db migration (#35631)
lin-snow Apr 28, 2026
217ab4d
fix(web): filter model selector by model name (#35624)
WTW0313 Apr 28, 2026
4f669f3
chore: port one api (#35609)
asukaminato0721 Apr 28, 2026
bce61ff
fix: hit-testing response failed because of Pydantic check. (#35640)
FFXN Apr 28, 2026
03df342
chore: correction of ru translation (#35645)
knyazz Apr 29, 2026
84df9d2
fix: flaky WordExtractor close test in CI (#35652)
kenwoodjw Apr 29, 2026
74cc6af
chore: update rbac pydantic model
fatelei May 7, 2026
c386908
refactor: refactor rbac service api
fatelei May 7, 2026
9fa1e69
feat: refactor access control service imports to use new module struc…
WTW0313 May 8, 2026
435c8ec
refactor: refactor rbac api
fatelei May 8, 2026
1eb6446
chore: remove enterprise_only decorator
fatelei May 8, 2026
7442e91
chore: remove enterprise check
fatelei May 8, 2026
248e14c
feat: add ENTERPRISE_RBAC_API_URL env
fatelei May 8, 2026
a4d12ef
chore: compatiable none list
fatelei May 8, 2026
35696c6
feat: implement role management features with hooks and UI components
WTW0313 May 9, 2026
212252b
chore: compatiable result is none
fatelei May 9, 2026
f7807c5
feat: add app and dataset access rule sections with hooks for managin…
WTW0313 May 9, 2026
d1ad013
feat: support role copy
fatelei May 9, 2026
3dcea78
chore: compatiable without rbac
fatelei May 11, 2026
d90825f
fix: fix permission key format and fix role return format
fatelei May 11, 2026
a409a0c
chore: skip old auth check when rbac enabled
fatelei May 11, 2026
3aa8abb
feat: add role duplication functionality with copy role hook
WTW0313 May 11, 2026
e44252c
feat: list app and dataset permission keys
fatelei May 11, 2026
d878a29
feat: enhance access rule management with account bindings and role h…
WTW0313 May 11, 2026
97c406f
fix: fix response format
fatelei May 11, 2026
b3572c6
fix: fixme
fatelei May 11, 2026
5086dfc
fix: fixme
fatelei May 11, 2026
a3b00a2
fix: add miss name
fatelei May 11, 2026
9609f00
feat: refactor access rule management to use updated role and account…
WTW0313 May 12, 2026
e2153a6
feat: system feature return rbac enabled
fatelei May 12, 2026
57da82c
Merge remote-tracking branch 'origin/main' into feat/rbac
CourTeous33 May 12, 2026
b8ab02b
feat: invite member support rbac
fatelei May 12, 2026
05b3541
Merge branch 'main' into feat/rbac
WTW0313 May 12, 2026
7aa8f1a
fix: Fix frontend build error caused by merging main
WTW0313 May 12, 2026
4d89128
feat: add include owner param
fatelei May 12, 2026
cbedd2b
feat: refactor access rule management to utilize new app and dataset …
WTW0313 May 12, 2026
3cc8107
Merge remote-tracking branch 'upstream/feat/rbac' into feat/rbac
fatelei May 12, 2026
74deadf
Merge remote-tracking branch 'upstream/feat/rbac' into feat/rbac
fatelei May 12, 2026
e1b7546
fix: fix owner filter condition
fatelei May 12, 2026
319e71b
fix: fix missing role_tag
fatelei May 12, 2026
7e0a3ee
feat: update role management to use RoleListRequest for improved pagi…
WTW0313 May 12, 2026
19ace80
chore: update legacy permission keys
fatelei May 13, 2026
cea4cd5
feat: implement role-based access control (RBAC) features, including …
WTW0313 May 13, 2026
06ffdbc
Merge branch 'main' into feat/rbac
WTW0313 May 13, 2026
f6d22c2
feat: enhance role and permission management with internationalizatio…
WTW0313 May 13, 2026
5e1f6e7
fix: fix owner transfer
fatelei May 13, 2026
699cca0
feat: remove DatasetAccessConfigModal and refactor access configurati…
WTW0313 May 13, 2026
f5e9009
feat: migrate role to rbac
fatelei May 13, 2026
d213e89
fix: fix add miss file
fatelei May 13, 2026
dbf6669
fix: fix member list roles response
fatelei May 13, 2026
a9f0d65
fix: fix miss role_tag
fatelei May 13, 2026
be04614
feat: add role removal functionality and update PermissionRoleChip pr…
WTW0313 May 13, 2026
4f01445
refactor: Update localization files for member roles and permissions
WTW0313 May 13, 2026
1ae91c1
fix: update role selection logic to use role ID instead of name
WTW0313 May 13, 2026
bff0cf1
chore: add feat/rbac branch to workflow triggers
WTW0313 May 14, 2026
b30219c
Merge branch 'main' into feat/rbac
WTW0313 May 14, 2026
c133e3a
feat: implement role-based access control with permission checks acro…
WTW0313 May 14, 2026
c893733
refactor: remove createButtonLabel prop and update button text in acc…
WTW0313 May 15, 2026
e51858f
refactor: Refactor permission management components and update transl…
WTW0313 May 15, 2026
e3ad44e
feat: enhance permission handling for credential and model management
WTW0313 May 15, 2026
658b8d0
Merge branch 'main' into feat/rbac
WTW0313 May 15, 2026
363fb7e
Merge branch 'main' into feat/rbac
WTW0313 May 18, 2026
a5c59a0
feat: enhance permission handling and UI updates across various compo…
WTW0313 May 18, 2026
bddac3e
feat: app detail return permission keys
fatelei May 18, 2026
0af206b
feat: enhance access control capabilities across datasets and workflows
WTW0313 May 18, 2026
f753e76
Merge branch 'main' into feat/rbac
WTW0313 May 19, 2026
e9790e7
fix: update checkbox imports to use the new UI library components
WTW0313 May 19, 2026
ba0751b
Merge branch 'main' into feat/rbac
WTW0313 May 19, 2026
b11094d
fix: fix response
fatelei May 19, 2026
e13849f
feat: implement access control hooks for editable workflows and datasets
WTW0313 May 19, 2026
cbf48af
fix: fix param
fatelei May 19, 2026
5fbed88
refactor: refine role assignment logic and enhance dataset access per…
WTW0313 May 19, 2026
8348aed
refactor: enhance plugin installation permissions across components
WTW0313 May 20, 2026
5481fb2
feat: enhance plugin management permissions and update handling
WTW0313 May 20, 2026
e7fc433
refactor: simplify role permission checks in account settings
WTW0313 May 20, 2026
fd71780
Merge branch 'main' into feat/rbac
WTW0313 May 20, 2026
717d00a
Merge branch 'main' into feat/rbac
WTW0313 May 21, 2026
8c3ca53
feat: implement delete confirmation dialogs for access rules and roles
WTW0313 May 21, 2026
b53d325
feat: enhance role-based access control with workspace permission key…
WTW0313 May 21, 2026
9610cd0
feat: update role-based access control to utilize workspace permissio…
WTW0313 May 21, 2026
eea8211
feat: enhance permission handling for credential management and app l…
WTW0313 May 21, 2026
44c00b7
feat: enhance role-based access control with workspace permission che…
WTW0313 May 21, 2026
a2a3ad1
feat: enhance dataset access control with redirection logic based on …
WTW0313 May 21, 2026
3e59757
feat: enhance permission checks for MCP management across components
WTW0313 May 21, 2026
65ad573
feat: enhance access rule management with view functionality and perm…
WTW0313 May 21, 2026
bb9b452
Merge branch 'main' into feat/rbac
WTW0313 May 21, 2026
5554fac
feat: enhance role and permission management with i18n support
WTW0313 May 21, 2026
e5e90ea
feat: enhance credential management by updating permission checks and…
WTW0313 May 22, 2026
5d8b767
feat: enhance AppInfoDetailPanel with permission checks for duplicate…
WTW0313 May 22, 2026
54cecb3
fix: fix invite member
fatelei May 22, 2026
8cb8bb7
fix: fix param
fatelei May 22, 2026
43bddd9
refactor: update app permissions handling and improve ACL capabilities
WTW0313 May 22, 2026
0c5b41f
feat: enhance app permissions handling by adding release and version …
WTW0313 May 22, 2026
df49e83
feat: enhance dataset document permissions and editing capabilities
WTW0313 May 22, 2026
40f7675
feat: add resourceId prop to AccessRulesEditor for app and dataset ac…
WTW0313 May 22, 2026
7aac3ba
Merge branch 'main' into feat/rbac
WTW0313 May 22, 2026
7f06534
Merge branch 'main' into feat/rbac
WTW0313 May 24, 2026
52b9373
feat: enhance NavSelector to manage create permissions based on works…
WTW0313 May 25, 2026
41936ff
feat: implement app ACL permissions in TriggerCard to control switch …
WTW0313 May 25, 2026
18cc5b9
feat: enhance secret key management and permissions handling across c…
WTW0313 May 25, 2026
dad977d
feat: refactor dataset permissions handling and remove legacy workspa…
WTW0313 May 25, 2026
f90805e
feat: update permission handling in dataset components to utilize ACL…
WTW0313 May 25, 2026
c9620aa
feat: refactor dataset settings to remove legacy workspace role check…
WTW0313 May 25, 2026
9875c5c
feat: refactor SystemModel to use permission-based access control ins…
WTW0313 May 25, 2026
f5c4923
feat: import app return permission keys
fatelei May 25, 2026
0d238a3
refactor: Remove Serpapi plugin integration and related tests
WTW0313 May 25, 2026
b83d8c7
feat: implement permission-based management for custom web app branding
WTW0313 May 25, 2026
555074d
feat: refactor redirection logic to utilize app ACL capabilities and …
WTW0313 May 25, 2026
62bc410
feat: remove temporary true value in apps page permission check
WTW0313 May 25, 2026
78c2515
Merge branch 'main' into feat/rbac
WTW0313 May 25, 2026
8e2ac9d
Merge branch 'main' into feat/rbac
WTW0313 May 25, 2026
d7b265e
feat: copy app return permission keys
fatelei May 25, 2026
80fa09a
fix: Add view action condition in RowMenu component
WTW0313 May 25, 2026
e88aae0
Merge branch 'feat/rbac' of https://github.com/langgenius/dify into f…
WTW0313 May 25, 2026
fcd5e88
feat: update layout and structure of permission-related components
WTW0313 May 25, 2026
b2edab0
test: Add unit tests for access configuration and permissions management
WTW0313 May 26, 2026
e13e905
feat: enhance DatasetDetailLayout to conditionally render extra info …
WTW0313 May 26, 2026
87ac364
feat: update permission handling in useReferenceSetting and related t…
WTW0313 May 26, 2026
b7d5200
feat: enhance PermissionSelector with access configuration handling a…
WTW0313 May 26, 2026
6813875
fix: fix dataset miss permission keys
fatelei May 26, 2026
cba4df0
feat: implement RBAC support in permission handling and update relate…
WTW0313 May 26, 2026
1418116
feat: add workspace ID handling in API requests and context provider
WTW0313 May 26, 2026
d2da5d8
feat: add access configuration keys for apps, datasets, and pages in …
WTW0313 May 26, 2026
5dbad23
fix: fix miss account name
fatelei May 26, 2026
47658b3
feat: implement credential-based access control in Card component and…
WTW0313 May 26, 2026
5cd967e
Merge branch 'feat/rbac' of https://github.com/langgenius/dify into f…
WTW0313 May 26, 2026
1de63ca
feat: update role and permission terminology in UI and localization f…
WTW0313 May 26, 2026
ad872ce
fix: fix app miss
fatelei May 27, 2026
7db3a52
fix: member invite limits with dedup, locking, and accurate new-membe…
linw1995 May 25, 2026
6d6ea88
chore: use dify_config.BILLING_ENABLED (#36619)
hjlarry May 25, 2026
af935ff
feat: output declaration and inspector (#36618)
zyssyz123 May 25, 2026
6f5c531
fix: normalize app icon picker dialog state (#36621)
lyzno1 May 25, 2026
2cf03f3
chore: example of current user id dep injection (#36588)
asukaminato0721 May 25, 2026
086f148
chore: inject current user in console handlers (#36628)
Tianlel May 25, 2026
bd9fa4e
fix: normalize summary_index_setting None to fix preview error (#36626)
EvanYao826 May 25, 2026
b37922a
chore: dep inject for sql session (#36545)
asukaminato0721 May 25, 2026
8252ffd
fix(security): reject path traversal sequences before plugin daemon f…
xr843 May 25, 2026
31a454a
fix: remove unused datasource_parameters from Notion pre-import query…
EvanYao826 May 26, 2026
6c0bbef
feat: adding dify cli (#36348)
wylswz May 26, 2026
ebe8456
feat(dify-ui): add textarea primitive (#36547)
lyzno1 May 26, 2026
73dad96
feat(dify-agent): sync agent progress (#36633)
BeautyyuYanli May 26, 2026
68b1e9f
chore: inject current user in explore message handlers (#36652)
Tianlel May 26, 2026
fed282c
chore: inject tenant id in feature handlers (#36654)
Tianlel May 26, 2026
b02d808
chore: inject account context in file handlers (#36655)
Tianlel May 26, 2026
c318698
chore: inject tenant id in extension handlers (#36656)
Tianlel May 26, 2026
91b6151
chore(deps): bump boto3 from 1.43.10 to 1.43.14 in /api in the storag…
dependabot[bot] May 26, 2026
83a748a
chore: add dependabot to lts branch (#36424)
wylswz May 26, 2026
3f4659e
feat(api): Node Output Inspector service + 3 REST endpoints (Stage 4 …
zyssyz123 May 26, 2026
87455a0
fix(dify-ui): align picker stories with Base UI (#36680)
lyzno1 May 26, 2026
1fc93d4
refactor(api): migrate console tags to tenant/user via DI and improve…
cqjjjzr May 26, 2026
f11869c
refactor(api): migrate tenant/user via DI: apikey, extension, data_so…
cqjjjzr May 26, 2026
3469728
chore: add InstalledApp type annotations to api endpoints (#36678)
Lillian68 May 26, 2026
6389021
chore: backend feature api exclude_vector_space (#36642)
hjlarry May 26, 2026
63b65e4
fix(chat): close streaming LLM generator when stop response is trigge…
zeus1959 May 26, 2026
53db195
chore: add EndUser and App type annotations to api endpoints (#36677)
Lillian68 May 26, 2026
f135152
chore: add App type annotations to api endpoints (#36675)
Lillian68 May 26, 2026
a3cb58f
fix(plugin): align local install modal spacing (#36689)
lyzno1 May 27, 2026
1e0874a
fix: Fix web build errors
WTW0313 May 27, 2026
dffa38f
feat: update access configuration terminology in UI and localization …
WTW0313 May 27, 2026
ed05181
feat: update permission handling for app and dataset management
WTW0313 May 27, 2026
075e074
refactor: Refactor app detail fetching and caching logic
WTW0313 May 27, 2026
59907af
feat: enhance role badge component with memoization and improved styling
WTW0313 May 27, 2026
e0b8219
feat: implement API key management permissions and update related tests
WTW0313 May 27, 2026
d466738
feat: enhance invite modal with role selection and update related tests
WTW0313 May 28, 2026
4917476
feat: update duplicate action terminology and enhance member role han…
WTW0313 May 28, 2026
a8cbdae
feat: enhance member role assignment functionality and update related…
WTW0313 May 28, 2026
b0f09d6
feat: optimize dropdown options calculation using useMemo for perform…
WTW0313 May 28, 2026
4c15e16
Merge remote-tracking branch 'upstream/main' into feat/rbac
fatelei May 28, 2026
fb254cd
fix: Fix web build errors
WTW0313 May 28, 2026
015bf26
feat: update model selector to disable buttons based on permissions a…
WTW0313 May 28, 2026
73cb24f
feat: enhance layout and styling of permissions page components for i…
WTW0313 May 28, 2026
c09ea2f
fix: fix permission check
fatelei May 29, 2026
c1c48a0
Merge branch 'main' into feat/rbac
WTW0313 May 29, 2026
f93dd77
feat: return account avatar
fatelei May 29, 2026
6a63314
feat: lock and unlock api
fatelei May 29, 2026
d661768
feat: update permission checks to remove 'view' permissions and strea…
WTW0313 May 29, 2026
7fb54da
feat: update permission keys and refactor access control logic across…
WTW0313 May 29, 2026
55cc05a
fix: fix account avatar miss
fatelei Jun 2, 2026
c28c761
feat: implement infinite scrolling for access rules and enhance acces…
WTW0313 Jun 2, 2026
e3ae7e6
feat: update role icons and enhance styling for permissions page comp…
WTW0313 Jun 2, 2026
565d563
feat: enhance access rule components with loading states and role man…
WTW0313 Jun 2, 2026
b8c5d3e
feat: enhance member details modal with role action menu and permissi…
WTW0313 Jun 2, 2026
6496254
feat: implement role and member locking in AddRuleTargetsModal and en…
WTW0313 Jun 2, 2026
8889484
feat: enhance AccessRulesEditor and related components with role mana…
WTW0313 Jun 2, 2026
7e5d5c2
feat: implement role binding lock/unlock functionality and update rel…
WTW0313 Jun 2, 2026
5f9b803
feat: add loading state handling in AccessRulesEditor and related com…
WTW0313 Jun 2, 2026
55afd99
feat: legacy return permission keys
fatelei Jun 2, 2026
6b0cb0a
feat: refactor permission handling in AppDetailLayout and related com…
WTW0313 Jun 2, 2026
2451600
feat: improve conditional rendering for remove action in RoleTag comp…
WTW0313 Jun 2, 2026
bdb26a8
feat: update permission keys for managing plugin preferences in multi…
WTW0313 Jun 2, 2026
a216279
feat: enhance RoleTag component to conditionally show remove action b…
WTW0313 Jun 3, 2026
b48d321
Merge branch 'main' into feat/rbac
WTW0313 Jun 3, 2026
a4fd6d8
refactor: reorder imports in RoleRouteGuard component for clarity
WTW0313 Jun 3, 2026
6fdd737
feat: add rbac_enabled flag to default system features configuration
WTW0313 Jun 3, 2026
fcfcef4
feat: update default permission flags and enhance component behavior …
WTW0313 Jun 3, 2026
b3ad7b5
feat: add setNeedRefresh to dependencies in useAppInfoActions, Create…
WTW0313 Jun 3, 2026
2ea7c75
feat: update permission configuration instructions in English and Chi…
WTW0313 Jun 3, 2026
2bce696
feat: create app return permission keys
fatelei Jun 3, 2026
600b477
Merge remote-tracking branch 'upstream/main' into feat/rbac
fatelei Jun 3, 2026
d4c1374
feat: enhance app redirection logic and update dataset permission han…
WTW0313 Jun 3, 2026
462adaf
fix: gate RBAC role assignment and access config
WTW0313 Jun 3, 2026
d7ca2bc
feat: update Member type to use Role array for role management
WTW0313 Jun 3, 2026
4597dfb
feat: enhance app creation and browsing flows with permission handlin…
WTW0313 Jun 3, 2026
8b08cd8
feat: update local storage handling for app list refresh logic
WTW0313 Jun 3, 2026
18ffe5e
Merge branch 'main' into feat/rbac
WTW0313 Jun 4, 2026
1eb67ee
fix: adjust class names for consistent styling in RoleTag component
WTW0313 Jun 4, 2026
a23d294
feat: enhance workspace role deletion to invalidate member queries
WTW0313 Jun 4, 2026
de59ac3
feat: standardize rules per page limit in access rule sections
WTW0313 Jun 4, 2026
8e00b05
fix: fix miss import
fatelei Jun 4, 2026
1578f2c
fix: fix name error
fatelei Jun 4, 2026
e4afcf8
feat: add language support for access control templates in various co…
WTW0313 Jun 4, 2026
2e7f06d
chore: pass language param
fatelei Jun 4, 2026
4fce25b
feat: enhance empty state styling in PermissionGroupList component
WTW0313 Jun 4, 2026
dd8baa2
feat: update permission keys and refactor related components to use '…
WTW0313 Jun 4, 2026
4af953d
Merge branch 'main' into feat/rbac
WTW0313 Jun 5, 2026
301448a
feat: enhance layout and styling in account settings and permissions …
WTW0313 Jun 5, 2026
9a7356c
feat: update useMembers hook to accept language parameter for improve…
WTW0313 Jun 5, 2026
544c6f6
Merge branch 'main' into feat/rbac
WTW0313 Jun 5, 2026
5410777
fix: fix failed test and type check failed
fatelei Jun 8, 2026
125141b
feat: refactor useNodesSyncDraft to utilize useNodesReadOnlyByCanEdit…
WTW0313 Jun 8, 2026
142640e
fix: fix failed test
fatelei Jun 8, 2026
6071fb8
Merge branch 'main' into feat/rbac
WTW0313 Jun 8, 2026
91c113f
fix: fix failed test
fatelei Jun 8, 2026
ae7b25e
feat: update type definitions for various components and services to …
WTW0313 Jun 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- "release/e-*"
- "hotfix/**"
- "feat/hitl-backend"
- "feat/rbac"
tags:
- "*"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ jobs:
file: "web/Dockerfile"
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
uses: docker/setup-buildx-action@98e3b2c9eab4f4f98a95c0c0a3ea5e5e672fd2a8 # v3.10.0

- name: Build Docker Image
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
uses: docker/build-push-action@5cd29d66b4a8d8e6f4d5dfe2e9329f0b1d446289 # v6.18.0
with:
push: false
context: ${{ matrix.context }}
Expand Down
2 changes: 2 additions & 0 deletions api/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
setup_system_trigger_oauth_client,
transform_datasource_credentials,
)
from .rbac import migrate_member_roles_to_rbac
from .retention import (
archive_workflow_runs,
clean_expired_messages,
Expand Down Expand Up @@ -72,6 +73,7 @@
"migrate_annotation_vector_database",
"migrate_data_for_plugin",
"migrate_knowledge_vector_database",
"migrate_member_roles_to_rbac",
"migrate_oss",
"migration_data_wizard",
"old_metadata_migration",
Expand Down
109 changes: 109 additions & 0 deletions api/commands/rbac.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
from __future__ import annotations

import click
from sqlalchemy import select

from core.db.session_factory import session_factory
from models import TenantAccountJoin, TenantAccountRole
from services.enterprise.rbac_service import ListOption, RBACService


def _resolve_builtin_role_id(tenant_id: str, operator_account_id: str, legacy_role: str) -> str:
"""Resolve a legacy workspace role to the current tenant's builtin RBAC role id.

The migration replays the old `TenantAccountJoin.role` values onto the
RBAC member-role binding API. Builtin RBAC roles are tenant-scoped and
identified by runtime ids, so the command must look them up per tenant.
"""
expected_builtin_name = {
TenantAccountRole.OWNER.value: "所有者",
TenantAccountRole.ADMIN.value: "管理者",
TenantAccountRole.EDITOR.value: "编辑者",
TenantAccountRole.NORMAL.value: "普通用户",
TenantAccountRole.DATASET_OPERATOR.value: "知识库操作员",
}.get(legacy_role)
if not expected_builtin_name:
raise ValueError(f"Unsupported legacy workspace role: {legacy_role}")

roles = RBACService.Roles.list(
tenant_id=tenant_id,
account_id=operator_account_id,
options=ListOption(page_number=1, results_per_page=100),
).data
for role in roles:
if role.is_builtin and role.category == "global_system_default" and role.name == expected_builtin_name:
return str(role.id)

raise ValueError(f"Builtin RBAC role not found for tenant={tenant_id}, legacy_role={legacy_role}")


@click.command("rbac-migrate-member-roles", help="Migrate legacy workspace member roles into RBAC member-role bindings.")
@click.option("--tenant-id", help="Only migrate a single workspace.")
@click.option("--dry-run", is_flag=True, default=False, help="Preview the migration without writing RBAC bindings.")
def migrate_member_roles_to_rbac(tenant_id: str | None, dry_run: bool) -> None:
"""Backfill RBAC member-role bindings from legacy `TenantAccountJoin.role` data.

This is an offline migration command for workspaces that already have
members in the legacy role model but need matching records in the RBAC
member-role binding store.
"""
click.echo(click.style("Starting RBAC member-role migration.", fg="green"))

with session_factory.create_session() as session:
stmt = select(TenantAccountJoin).order_by(TenantAccountJoin.tenant_id.asc(), TenantAccountJoin.id.asc())
if tenant_id:
stmt = stmt.where(TenantAccountJoin.tenant_id == tenant_id)

joins = list(session.scalars(stmt).all())

if not joins:
click.echo(click.style("No workspace members found for migration.", fg="yellow"))
return

owner_account_by_tenant: dict[str, str] = {}
resolved_role_ids: dict[tuple[str, str], str] = {}
migrated_count = 0

for join in joins:
workspace_id = str(join.tenant_id)
member_account_id = str(join.account_id)
legacy_role = str(join.role)

if workspace_id not in owner_account_by_tenant:
owner_join = next(
(
item
for item in joins
if str(item.tenant_id) == workspace_id and str(item.role) == TenantAccountRole.OWNER.value
),
None,
)
if not owner_join:
raise ValueError(f"Workspace owner not found for tenant={workspace_id}")
owner_account_by_tenant[workspace_id] = str(owner_join.account_id)

operator_account_id = owner_account_by_tenant[workspace_id]
cache_key = (workspace_id, legacy_role)
if cache_key not in resolved_role_ids:
resolved_role_ids[cache_key] = _resolve_builtin_role_id(workspace_id, operator_account_id, legacy_role)

resolved_role_id = resolved_role_ids[cache_key]
click.echo(
f"tenant={workspace_id} member={member_account_id} legacy_role={legacy_role} -> rbac_role_id={resolved_role_id}"
)

if dry_run:
continue

RBACService.MemberRoles.replace(
tenant_id=workspace_id,
account_id=operator_account_id,
member_account_id=member_account_id,
role_ids=[resolved_role_id],
)
migrated_count += 1

if dry_run:
click.echo(click.style("Dry run completed. No RBAC bindings were written.", fg="yellow"))
else:
click.echo(click.style(f"RBAC member-role migration completed. Migrated {migrated_count} members.", fg="green"))
5 changes: 5 additions & 0 deletions api/configs/enterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class EnterpriseFeatureConfig(BaseSettings):
"This helps gain runtime performance by trading off consistency.",
)

RBAC_ENABLED: bool = Field(
description="Enable enterprise RBAC APIs. When disabled, compatibility responses fall back to legacy roles.",
default=False,
)


class EnterpriseTelemetryConfig(BaseSettings):
"""
Expand Down
1 change: 1 addition & 0 deletions api/controllers/common/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class ApiBaseUrlResponse(ResponseModel):

class NewAppResponse(ResponseModel):
new_app_id: str
permission_keys: list[str] = Field(default_factory=list)


class Parameters(BaseModel):
Expand Down
2 changes: 2 additions & 0 deletions api/controllers/console/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
models,
plugin,
snippets,
rbac,
tool_providers,
trigger_providers,
workspace,
Expand Down Expand Up @@ -210,6 +211,7 @@
"rag_pipeline_draft_variable",
"rag_pipeline_import",
"rag_pipeline_workflow",
"rbac",
"recommended_app",
"saved_message",
"setup",
Expand Down
66 changes: 62 additions & 4 deletions api/controllers/console/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@
from core.rag.entities import PreProcessingRule, Rule, Segmentation
from core.rag.retrieval.retrieval_methods import RetrievalMethod
from core.trigger.constants import TRIGGER_NODE_TYPES
from configs import dify_config
from extensions.ext_database import db
from fields.base import ResponseModel
from graphon.enums import WorkflowExecutionStatus
from libs.helper import build_icon_url, to_timestamp
from libs.login import login_required
from libs.login import current_account_with_tenant as current_account_with_tenant, login_required
from models import Account, App, DatasetPermissionEnum, Workflow
from models.model import IconType
from services.app_dsl_service import AppDslService
from services.app_service import AppListParams, AppService, CreateAppParams
from services.enterprise.enterprise_service import EnterpriseService
from services.enterprise import rbac_service as enterprise_rbac_service
from services.entities.dsl_entities import ImportMode, ImportStatus
from services.entities.knowledge_entities.knowledge_entities import (
DataSource,
Expand Down Expand Up @@ -377,6 +379,7 @@ class AppPartial(ResponseModel):
create_user_name: str | None = None
author_name: str | None = None
has_draft_trigger: bool | None = None
permission_keys: list[str] = Field(default_factory=list)

@computed_field(return_type=str | None) # type: ignore
@property
Expand Down Expand Up @@ -412,6 +415,7 @@ class AppDetail(ResponseModel):
updated_at: int | None = None
access_mode: str | None = None
tags: list[Tag] = Field(default_factory=list)
permission_keys: list[str] = Field(default_factory=list)

@field_validator("created_at", "updated_at", mode="before")
@classmethod
Expand Down Expand Up @@ -446,6 +450,22 @@ class AppExportResponse(ResponseModel):
data: str


def _collect_app_access_permission_keys(access_matrix: enterprise_rbac_service.AppAccessMatrix) -> list[str]:
permission_keys: list[str] = []
seen_permission_keys: set[str] = set()

for item in access_matrix.items:
if not item.policy:
continue
for permission_key in item.policy.permission_keys:
if permission_key in seen_permission_keys:
continue
seen_permission_keys.add(permission_key)
permission_keys.append(permission_key)

return permission_keys


register_enum_models(console_ns, RetrievalMethod, WorkflowExecutionStatus, DatasetPermissionEnum)
register_response_schema_models(console_ns, RedirectUrlResponse, SimpleResultResponse)

Expand Down Expand Up @@ -534,6 +554,16 @@ def get(self, current_tenant_id: str, current_user_id: str, session: Session):
if str(app.id) in res:
app.access_mode = res[str(app.id)].access_mode

if app_pagination.items:
app_ids = [str(app.id) for app in app_pagination.items]
permission_keys_map = enterprise_rbac_service.RBACService.AppPermissions.batch_get(
str(current_tenant_id),
current_user_id,
app_ids,
)
for app in app_pagination.items:
app.permission_keys = permission_keys_map.get(str(app.id), [])

workflow_capable_app_ids = [
str(app.id) for app in app_pagination.items if app.mode in {"workflow", "advanced-chat"}
]
Expand Down Expand Up @@ -595,6 +625,12 @@ def post(self, current_tenant_id: str, current_user: Account):

app_service = AppService()
app = app_service.create_app(current_tenant_id, params, current_user)
permission_keys_map = enterprise_rbac_service.RBACService.AppPermissions.batch_get(
str(current_tenant_id),
current_user.id,
[str(app.id)],
)
setattr(app, "permission_keys", permission_keys_map.get(str(app.id), []))
app_detail = AppDetail.model_validate(app, from_attributes=True)
return app_detail.model_dump(mode="json"), 201

Expand All @@ -610,7 +646,9 @@ class AppApi(Resource):
@account_initialization_required
@enterprise_license_required
@get_app_model(mode=None)
def get(self, app_model: App):
@with_current_user
@with_current_tenant_id
def get(self, current_tenant_id: str, current_user: Account, app_model: App):
"""Get app detail"""
app_service = AppService()

Expand All @@ -620,6 +658,13 @@ def get(self, app_model: App):
app_setting = EnterpriseService.WebAppAuth.get_app_access_mode_by_id(app_id=str(app_model.id))
app_model.access_mode = app_setting.access_mode # type: ignore[attr-defined]

permission_keys_map = enterprise_rbac_service.RBACService.AppPermissions.batch_get(
str(current_tenant_id),
current_user.id,
[str(app_model.id)],
)
setattr(app_model, "permission_keys", permission_keys_map.get(str(app_model.id), []))

response_model = AppDetailWithSite.model_validate(app_model, from_attributes=True)
return response_model.model_dump(mode="json")

Expand Down Expand Up @@ -686,12 +731,17 @@ class AppCopyApi(Resource):
@get_app_model(mode=None)
@edit_permission_required
@with_current_user
def post(self, current_user: Account, app_model: App):
@with_current_tenant_id
def post(self, current_tenant_id: str, current_user: Account, app_model: App):
"""Copy app"""
# The role of the current user in the ta table must be admin, owner, or editor
args = CopyAppPayload.model_validate(console_ns.payload or {})

with Session(db.engine, expire_on_commit=False) as session:
session = Session(expire_on_commit=False)
if session.bind is None:
session.bind = db.engine

with session:
import_service = AppDslService(session)
yaml_content = import_service.export_dsl(app_model=app_model, include_secret=True)
result = import_service.import_app(
Expand Down Expand Up @@ -728,6 +778,14 @@ def post(self, current_user: Account, app_model: App):
stmt = select(App).where(App.id == result.app_id)
app = session.scalar(stmt)

if app:
permission_keys_map = enterprise_rbac_service.RBACService.AppPermissions.batch_get(
str(current_tenant_id),
current_user.id,
[str(app.id)],
)
setattr(app, "permission_keys", permission_keys_map.get(str(app.id), []))

response_model = AppDetailWithSite.model_validate(app, from_attributes=True)
return response_model.model_dump(mode="json"), 201

Expand Down
Loading
Loading