Jelajahi Sumber

update 调整流程撤销如果非发起人或管理员不可以撤销

gssong 3 bulan lalu
induk
melakukan
12bcc68b45

+ 4 - 1
ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwInstanceServiceImpl.java

@@ -289,8 +289,11 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
         if (definition == null) {
             throw new ServiceException(ExceptionCons.NOT_FOUNT_DEF);
         }
-        String message = bo.getMessage();
         String userIdStr = LoginHelper.getUserIdStr();
+        if (!LoginHelper.isSuperAdmin() && !instance.getCreateBy().equals(userIdStr)) {
+            throw new ServiceException("权限不足,无法撤销流程!");
+        }
+        String message = bo.getMessage();
         BusinessStatusEnum.checkCancelStatus(instance.getFlowStatus());
         FlowParams flowParams = FlowParams.build()
             .message(message)