提交 6e4a8f1a 编写于 作者: S shiziyuan9527

fix: 修复评审的发起人不能关联用例的问题

上级 badbe8ed
......@@ -360,9 +360,16 @@ public class TestCaseReviewService {
public void testReviewRelevance(ReviewRelevanceRequest request) {
String reviewId = request.getReviewId();
List<String> userIds = getTestCaseReviewerIds(reviewId);
String creator = "";
TestCaseReview review = testCaseReviewMapper.selectByPrimaryKey(reviewId);
if (review != null) {
creator = review.getCreator();
}
String currentId = SessionUtils.getUser().getId();
if (!userIds.contains(currentId)) {
MSException.throwException("非用例评审人员,不能关联用例!");
if (!userIds.contains(currentId) && !StringUtils.equals(creator, currentId)) {
MSException.throwException("没有权限,不能关联用例!");
}
List<String> testCaseIds = request.getTestCaseIds();
......
......@@ -87,8 +87,13 @@ public class TestReviewTestCaseService {
private void checkReviewer(String reviewId) {
List<String> userIds = testCaseReviewService.getTestCaseReviewerIds(reviewId);
String currentId = SessionUtils.getUser().getId();
if (!userIds.contains(currentId)) {
MSException.throwException("非用例评审人员,不能解除用例关联!");
TestCaseReview caseReview = testCaseReviewMapper.selectByPrimaryKey(reviewId);
String creator = "";
if (caseReview != null) {
creator = caseReview.getCreator();
}
if (!userIds.contains(currentId) && !StringUtils.equals(creator, currentId)) {
MSException.throwException("没有权限,不能解除用例关联!");
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册