Skip to content

feat: privilege-apply CE stubs, controllers and permission point - #674

Open
LordofAvernus wants to merge 6 commits into
mainfrom
dms/feat-982
Open

feat: privilege-apply CE stubs, controllers and permission point#674
LordofAvernus wants to merge 6 commits into
mainfrom
dms/feat-982

Conversation

@LordofAvernus

@LordofAvernus LordofAvernus commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

User description

关联的 issue

https://github.com/actiontech/dms-ee/issues/982

描述你的变更

  • 提权申请 API/DTO 与 CE stub
  • HTTP controller 与工作台 denial middleware 钩子
  • privilege_apply_audit 权限点与文案

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc

Made with Cursor


Description

  • 新增提权申请API及数据结构

  • 添加提权申请HTTP控制器及中间件

  • 更新权限点种子、常量与国际化文本

  • 增加单元测试验证权限点初始化幂等性


Diagram Walkthrough

flowchart LR
  A["新增提权申请API定义"] --> B["实现HTTP控制器"]
  B --> C["路由注册及中间件配置"]
  C --> D["更新权限点种子与常量"]
  D --> E["新增单元测试验证"]
Loading

File Walkthrough

Relevant files
Enhancement
15 files
privilege_apply_workflow.go
定义提权申请工作流API及数据结构                                                                               
+178/-0 
privilege_apply_controller.go
新增提权申请接口控制器实现                                                                                       
+186/-0 
router.go
新增提权申请路由及中间件                                                                                         
+4/-0     
op_permission.go
添加提权审批权限点种子定义                                                                                       
+7/-0     
prepare.go
补齐提权审批权限点初始化逻辑                                                                                     
const.go
新增提权审批权限点常量                                                                                           
+5/-0     
op_permission.go
更新权限点映射包含提权审批                                                                                       
+2/-0     
privilege_apply_workflow_ce.go
添加开源版提权申请返回不支持实现                                                                                 
+50/-0   
service.go
注入新增提权申请工作流usecase                                                                             
+6/-0     
user.go
用户权限转换映射提权审批权限                                                                                     
+2/-0     
privilege_apply_workflow.go
实现提权申请工作流业务逻辑及数据模型                                                                             
+232/-0 
privilege_apply_workflow_ce.go
开源版提权申请业务逻辑stub实现                                                                               
+29/-0   
privilege_denied.go
添加SQL解析与权限不足错误处理逻辑                                                                             
+95/-0   
privilege_denied_middleware_ce.go
引入空操作权限不足中间件实现(CE版)                                                                           
+18/-0   
user.go
扩展用户API中提权审批权限类型                                                                                 
+6/-0     
Tests
1 files
op_permission_init_test.go
新增提权审批权限点初始化测试                                                                                     
+123/-0 
Documentation
2 files
message_zh.go
添加提权审批权限国际化名称与描述                                                                                 
+2/-0     
active.zh.toml
新增提权审批权限对应多语言文本                                                                                   
+2/-0     
Additional files
1 files
prepare.go +4/-4     

Introduce workflow DTO/types with CE no-op service and denial middleware stubs.
Expose controller methods for assignees/create/approve; wire workbench denial middleware slot.
Seed and expose the new op-permission used to qualify privilege-apply approvers.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit cafeeab)

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

潜在性能问题

当前启动流程中,对权限点种子的初始化是无条件执行的,即使权限点已有也会调用 InitOpPermissions。虽然该方法实现了幂等,但这可能导致不必要的数据库操作,建议根据配置在需要时再调用以减少额外开销。

// 权限点种子:每次启动幂等补齐缺失项(InitOpPermissions 对已存在 UID 跳过)
if err := opPermissionUsecase.InitOpPermissions(tx, initOpPermission()); nil != err {
	return err
}
if dmsConfig.NeedInitOpPermissions {

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

Align seed Module with design B-privilege_apply_audit_op_permission (账号管理).

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 054bfd5

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit fb526fc

Allow list-independent apply without SQL/error prefill while keeping
other Create required fields unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit cafeeab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant