Skip to content

fix(api): backport creator RBAC access fixes to LTS 1.17.x - #45385

Merged
wylswz merged 3 commits into
lts/1.17.xfrom
fix/backport-creator-rbac-lts-1.17.x
Nov 3, 2026
Merged

wylswz merged 3 commits into
lts/1.17.xfrom
fix/backport-creator-rbac-lts-1.17.x

Conversation

@zhangx1n

@zhangx1n zhangx1n commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport #42507 and #43941 to lts/1.17.x (EE 3.13.x). With RBAC enabled, restricted creators can see and reopen the Apps and knowledge bases they just created or imported.

  • fix(api): keep creator access to datasets created via console upload and RAG pipeline #42507: picked cleanly. Creator sync for datasets created via console upload and pipeline templates.
  • fix(api): preserve creator RBAC access across app and RAG pipeline creation #43941: the RAG pipeline, Dataset, and try_sync_creator_access_policy_member_bindings whitelist changes apply as upstream. Only the matching creator policies are appended to the App/Dataset whitelist.
  • App import on main runs through services/app/console_gateway.py, which does not exist on LTS. On this branch, initialize_imported_app_creator_access is called after commit in the existing paths instead:
    • console import and confirm (controllers/console/app/app_import.py)
    • OpenAPI import and confirm (controllers/openapi/app_dsl.py)
    • Inner API import (controllers/inner_api/app/dsl.py)
    • copy (AppDslService.copy_app)
  • Import.app_created (excluded from responses and schemas) replaces the Redis pending-data lookup that console confirm used to decide whether an app was newly created. Overwrites keep existing access.
  • test_console_gateway.py is not ported. The LTS console import, confirm, and copy tests now cover the same behavior.

Verification

weike-zhang and others added 2 commits November 3, 2026 03:11
…and RAG pipeline (#42507)

Co-authored-by: weike-zhang <wangweike@gmail.com>
Co-authored-by: Crazywoola <100913391+crazywoola@users.noreply.github.com>
(cherry picked from commit f832cff)
…eation (#43941)

Adapted to LTS 1.17.x: App import, confirm and copy initialize creator
access in the existing controllers and AppDslService instead of the
console gateway that only exists on main.

(cherry picked from commit 51a8dba)
Amp-Thread-ID: https://ampcode.com/threads/T-01a19f37-375f-7645-9260-69c071966f14
@zhangx1n
zhangx1n requested a review from a team November 3, 2026 03:52
@github-actions github-actions Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 64.18% 64.22% +0.04%
Strict coverage 63.79% 63.83% +0.04%
Typed symbols 46,186 46,269 +83
Untyped symbols 25,935 25,937 +2
Modules 3405 3405 0

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-11-03 10:09:07.264677169 +0000
+++ /tmp/pyrefly_pr.txt	2026-11-03 10:08:59.248627839 +0000
@@ -3333,7 +3333,7 @@
 ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `page` [bad-argument-type]
    --> tests/unit_tests/controllers/console/app/test_app_apis.py:963:51
 ERROR Generator function should return `Generator` [bad-return]
-  --> tests/unit_tests/controllers/console/app/test_app_import_api.py:86:29
+  --> tests/unit_tests/controllers/console/app/test_app_import_api.py:90:29
 ERROR Object of class `App` has no attribute `create_user_name` [missing-attribute]
    --> tests/unit_tests/controllers/console/app/test_app_response_models.py:255:5
 ERROR Object of class `App` has no attribute `permission_keys` [missing-attribute]
@@ -3417,7 +3417,7 @@
 ERROR Argument `Literal['custom']` is not assignable to parameter `mode` with type `ProcessRuleMode | SQLCoreOperations[ProcessRuleMode]` in function `models.dataset.DatasetProcessRule.__init__` [bad-argument-type]
    --> tests/unit_tests/controllers/console/datasets/test_datasets_document.py:280:67
 ERROR Argument `Literal['custom']` is not assignable to parameter `mode` with type `ProcessRuleMode | SQLCoreOperations[ProcessRuleMode]` in function `models.dataset.DatasetProcessRule.__init__` [bad-argument-type]
-    --> tests/unit_tests/controllers/console/datasets/test_datasets_document.py:1505:67
+    --> tests/unit_tests/controllers/console/datasets/test_datasets_document.py:1545:67
 ERROR Argument `Literal['opendal']` is not assignable to parameter `storage_type` with type `StorageType` in function `models.model.UploadFile.__init__` [bad-argument-type]
    --> tests/unit_tests/controllers/console/datasets/test_datasets_segments.py:137:22
 ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole` in function `models.model.UploadFile.__init__` [bad-argument-type]
@@ -8473,7 +8473,7 @@
 ERROR Object of class `object` has no attribute `kw` [missing-attribute]
    --> tests/unit_tests/services/test_clear_free_plan_tenant_expired_logs.py:761:12
 ERROR Object of class `NoneType` has no attribute `keyword_number` [missing-attribute]
-    --> tests/unit_tests/services/test_dataset_service_dataset.py:1035:16
+    --> tests/unit_tests/services/test_dataset_service_dataset.py:1036:16
 ERROR Argument `Literal['opendal']` is not assignable to parameter `storage_type` with type `StorageType` in function `models.model.UploadFile.__init__` [bad-argument-type]
    --> tests/unit_tests/services/test_dataset_service_document.py:127:22
 ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole` in function `models.model.UploadFile.__init__` [bad-argument-type]

@wylswz
wylswz requested a review from fatelei November 3, 2026 04:11
@wylswz
wylswz merged commit 911da36 into lts/1.17.x Nov 3, 2026
5 of 6 checks passed
@wylswz
wylswz deleted the fix/backport-creator-rbac-lts-1.17.x branch November 3, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants