| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| | | import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; |
| | | import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelMetaInfoVO; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelSaveReqVO; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO; |
| | |
| | | private Model validateModelManager(String id, Long userId) { |
| | | Model model = validateModelExists(id); |
| | | BpmModelMetaInfoVO metaInfo = BpmModelConvert.INSTANCE.parseMetaInfo(model); |
| | | // 超级管理员始终拥有流程模型的维护权限。 |
| | | // 背景:历史模型的 managerUserIds 可能为空(NULL / []),或指向已删除 / 已变更的用户, |
| | | // 严格校验会让这些模型再也无法修改(死锁,客户报「你不是该流程(xxx)的管理员」却无法自愈); |
| | | // 另外客户要求把流程管理员固定为超级管理员,此校验对其不再适用。 |
| | | if (SecurityFrameworkUtils.isSuperAdmin()) { |
| | | return model; |
| | | } |
| | | if (metaInfo == null || !CollUtil.contains(metaInfo.getManagerUserIds(), userId)) { |
| | | throw exception(MODEL_UPDATE_FAIL_NOT_MANAGER, model.getName()); |
| | | } |