2.0 KiB
2.0 KiB
Permission Console And Department Workflow Plan
Continue from the existing implementation. Do not rebuild the system from scratch.
Goal
Make the admin experience coherent around department-based permissions, keep admin as the only super admin, and move Dify operational controls into the user menu while keeping workspace behavior department-aware.
Outcomes
adminremains the onlysuper_admin- users are managed through modal create/edit flows
- departments become the primary access boundary for knowledge bases
- workspace exposes a department selector on the left and respects that scope
- Dify settings and Dify health move under the username menu
- stale-sync recovery uses toast feedback only
Backend
- Re-verify the unique-super-admin policy around
admin - Keep department-based visibility and department ownership on knowledge bases
- Ensure user payloads expose:
primary_department_idprimary_department_nameaccessible_department_idsextra_department_ids
- Keep Dify health and stale recovery endpoints, but align wording with “stuck sync” semantics
Frontend
- Workspace
- show department switcher in the left sidebar
- keep knowledge-base create/edit department ownership in dialogs
- expose
Dify设置andDify健康状态from the username menu
- Admin
- use the page as
权限管理 - left side: department management
- right side: users and department access
- create/edit users via modal only
- remove obsolete knowledge-base-management and recent-jobs sections
- use the page as
- Dify Health
- render as dialog from the username menu
- replace banner-style feedback with 3-second toast feedback
- explain each health metric in plain language
Validation
- run backend pytest
- run frontend build
- deploy
api + worker + frontend - smoke-check:
adminis the only super admin- department list and user list load
- workspace department switch filters knowledge bases
- Dify health opens from username menu and stale recovery shows toast