Repository navigation
feat: 强制同步限制为流程管理员操作 (#281) - #284
Merged
Merged
Conversation
- FlowForceSyncService 校验操作人 isFlowManager(),非流程管理员抛出 FlowPermissionException,避免绕过前端直接调用接口; - 新增 GET /api/query/workflow/permission/forceSync,供前端控制操作入口显隐; - 补充非流程管理员拒绝同步的单元测试。 Refs #281
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.
背景
Closes #281 的补充要求:强制同步属于流程管理员的高风险干预操作,需要限制只有流程管理员可以执行。
改动
FlowForceSyncService:操作人校验中增加isFlowManager()判断,非流程管理员抛出FlowPermissionException(permission.access.denied),防止绕过前端直接调用POST /api/cmd/record/forceSync;GET /api/query/workflow/permission/forceSync:返回当前登录用户是否可执行强制同步,供前端控制操作入口显隐;未登录/无用户上下文时返回false;FlowForceSyncServiceTest中同步操作人调整为流程管理员,并新增「非流程管理员拒绝同步」用例(共 8 例)。验证
./mvnw test -Dtest='!SpringFlowEventPublisherIntegrationTest'→ BUILD SUCCESS(该排除项为dev基线已有的异步事件时序失败);FlowForceSyncServiceTest:8 例全部通过;./mvnw -DskipTests install全量编译通过。