Repository navigation
fix(api): backport creator RBAC access fixes to LTS 1.17.x - #45385
Merged
Merged
Conversation
…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
requested review from
GareArc,
JohnJyong,
QuantumGhost and
laipz8200
as code owners
November 3, 2026 03:52
Contributor
Pyrefly Type Coverage
|
Contributor
Pyrefly Diffbase → 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]
|
fatelei
approved these changes
Nov 3, 2026
wylswz
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.try_sync_creator_access_policy_member_bindingswhitelist changes apply as upstream. Only the matching creator policies are appended to the App/Dataset whitelist.mainruns throughservices/app/console_gateway.py, which does not exist on LTS. On this branch,initialize_imported_app_creator_accessis called after commit in the existing paths instead:controllers/console/app/app_import.py)controllers/openapi/app_dsl.py)controllers/inner_api/app/dsl.py)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.pyis not ported. The LTS console import, confirm, and copy tests now cover the same behavior.Verification
tests/unit_tests/controllers+tests/unit_tests/services: 8877 passedlint-imports(31 contracts kept): passedservices/app_service.py, which this PR does not touch (see fix(api): repair lts/1.17.x type check and config-override guard after backports #45065)