refactor(测试跟踪): 用例评审取消关联用例只要有权限就行,无需判断创建人和评审人
--bug=1021813 --user=陈建星 【测试跟踪】用户有取消关联用例的权限,取消关联时提示无权限 https://www.tapd.cn/55049933/s/1326217
This commit is contained in:
parent
d92e2c657e
commit
60fa79d773
|
@ -111,7 +111,6 @@ public class TestReviewTestCaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int deleteTestCase(DeleteRelevanceRequest request) {
|
public int deleteTestCase(DeleteRelevanceRequest request) {
|
||||||
checkReviewer(request.getReviewId());
|
|
||||||
return testCaseReviewTestCaseMapper.deleteByPrimaryKey(request.getId());
|
return testCaseReviewTestCaseMapper.deleteByPrimaryKey(request.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,21 +129,7 @@ public class TestReviewTestCaseService {
|
||||||
return testCaseReviewTestCaseMapper.updateByExampleSelective(record, example);
|
return testCaseReviewTestCaseMapper.updateByExampleSelective(record, example);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkReviewer(String reviewId) {
|
|
||||||
List<String> userIds = testCaseReviewService.getTestCaseReviewerIds(reviewId);
|
|
||||||
String currentId = SessionUtils.getUser().getId();
|
|
||||||
TestCaseReview caseReview = testCaseReviewMapper.selectByPrimaryKey(reviewId);
|
|
||||||
String creator = StringUtils.EMPTY;
|
|
||||||
if (caseReview != null) {
|
|
||||||
creator = caseReview.getCreator();
|
|
||||||
}
|
|
||||||
if (!userIds.contains(currentId) && !StringUtils.equals(creator, currentId)) {
|
|
||||||
MSException.throwException("没有权限,不能解除用例关联!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteTestCaseBatch(TestReviewCaseBatchRequest request) {
|
public void deleteTestCaseBatch(TestReviewCaseBatchRequest request) {
|
||||||
checkReviewer(request.getReviewId());
|
|
||||||
ServiceUtils.getSelectAllIds(request, request.getCondition(),
|
ServiceUtils.getSelectAllIds(request, request.getCondition(),
|
||||||
(query) -> extTestReviewCaseMapper.selectIds((QueryCaseReviewRequest) query));
|
(query) -> extTestReviewCaseMapper.selectIds((QueryCaseReviewRequest) query));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue