Skip to content

feat: optimize resource access config logic - #41164

Open
WTW0313 wants to merge 22 commits into
mainfrom
user_access_policy_pagnination
Open

feat: optimize resource access config logic#41164
WTW0313 wants to merge 22 commits into
mainfrom
user_access_policy_pagnination

Conversation

@WTW0313

@WTW0313 WTW0313 commented Aug 24, 2026

Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and vp staged (frontend) to appease the lint gods

@github-actions github-actions Bot added the web This relates to changes on the web. label Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-08-25 10:59:54.906811501 +0000
+++ /tmp/pyrefly_pr.txt	2026-08-25 10:59:39.766729257 +0000
@@ -434,6 +434,8 @@
   --> providers/vdb/vdb-vikingdb/tests/unit_tests/test_vikingdb_vector.py:76:5
 ERROR Object of class `ModuleType` has no attribute `VikingDBService` [missing-attribute]
   --> providers/vdb/vdb-vikingdb/tests/unit_tests/test_vikingdb_vector.py:77:5
+ERROR Argument `str | None` is not assignable to parameter `dataset_id` with type `str` in function `services.enterprise.rbac_service.DatasetAccess.replace_whitelist` [bad-argument-type]
+  --> controllers/console/datasets/rag_pipeline/rag_pipeline_datasets.py:97:17
 ERROR Object of class `FromClause` has no attribute `metadata` [missing-attribute]
   --> tests/helpers/legacy_model_type_migration.py:64:16
 ERROR Object of class `FromClause` has no attribute `metadata` [missing-attribute]
@@ -1734,7 +1736,7 @@
   --> tests/unit_tests/commands/test_legacy_model_type_migration.py:72:16
 ERROR Object of class `FromClause` has no attribute `insert` [missing-attribute]
    --> tests/unit_tests/commands/test_legacy_model_type_migration.py:233:13
-ERROR Object of class `object` has no attribute `scope` [missing-attribute]
+ERROR Object of class `object` has no attribute `automatic_include_workspace_members` [missing-attribute]
    --> tests/unit_tests/commands/test_legacy_model_type_migration.py:437:12
 ERROR Object of class `object` has no attribute `callback` [missing-attribute]
    --> tests/unit_tests/commands/test_legacy_model_type_migration.py:537:5
@@ -3445,7 +3447,7 @@
 ERROR Argument `scoped_session[flask_sqlalchemy.session.Session]` is not assignable to parameter `session` with type `sqlalchemy.orm.session.Session` in function `_add_binding` [bad-argument-type]
   --> tests/unit_tests/controllers/console/datasets/test_data_source.py:85:28
 ERROR Missing argument `name` in function `controllers.console.datasets.datasets.DatasetCreatePayload.__init__` [missing-argument]
-   --> tests/unit_tests/controllers/console/datasets/test_datasets.py:528:49
+   --> tests/unit_tests/controllers/console/datasets/test_datasets.py:548:49
 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]

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 61.15% 61.14% -0.00%
Strict coverage 60.74% 60.74% -0.00%
Typed symbols 41,935 41,954 +19
Untyped symbols 26,821 26,838 +17
Modules 3248 3248 0

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.79903% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.72%. Comparing base (a9035a3) to head (f3c6897).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...eb/app/components/datasets/access-config/index.tsx 83.07% 11 Missing ⚠️
web/app/components/app/access-config/index.tsx 85.93% 9 Missing ⚠️
web/app/components/access-rules-editor/index.tsx 95.37% 5 Missing ⚠️
api/controllers/console/workspace/rbac.py 89.74% 1 Missing and 3 partials ⚠️
...access-rules-editor/add-access-subject-popover.tsx 90.00% 4 Missing ⚠️
...ervice/access-control/use-dataset-access-config.ts 72.72% 3 Missing ⚠️
...pp/components/access-rules-editor/batch-action.tsx 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #41164      +/-   ##
==========================================
+ Coverage   86.67%   86.72%   +0.04%     
==========================================
  Files        5273     5428     +155     
  Lines      302942   307340    +4398     
  Branches    60636    61838    +1202     
==========================================
+ Hits       262577   266531    +3954     
- Misses      35125    35573     +448     
+ Partials     5240     5236       -4     
Flag Coverage Δ
cli 89.34% <ø> (?)
dify-ui 93.75% <ø> (+<0.01%) ⬆️
web 86.76% <90.25%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@WTW0313 WTW0313 changed the title User access policy pagnination feat: User access policy pagnination Aug 24, 2026
@lyzno1 lyzno1 changed the title feat: User access policy pagnination feat: user access policy pagination Aug 24, 2026
@fatelei
fatelei marked this pull request as ready for review August 25, 2026 03:45
@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 25, 2026
@fatelei fatelei changed the title feat: user access policy pagination feat: optimize resource access config logic Aug 25, 2026
Comment thread web/app/components/access-rules-editor/__tests__/index.browser.spec.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants