refactor(测试跟踪): 用例评审取消关联用例只要有权限就行,无需判断创建人和评审人
--bug=1021813 --user=陈建星 【测试跟踪】用户有取消关联用例的权限,取消关联时提示无权限 https://www.tapd.cn/55049933/s/1326217
This commit is contained in:
parent
cfa09d83df
commit
e2f1d4eb90
|
@ -111,7 +111,6 @@ public class TestReviewTestCaseService {
|
|||
}
|
||||
|
||||
public int deleteTestCase(DeleteRelevanceRequest request) {
|
||||
checkReviewer(request.getReviewId());
|
||||
return testCaseReviewTestCaseMapper.deleteByPrimaryKey(request.getId());
|
||||
}
|
||||
|
||||
|
@ -130,21 +129,7 @@ public class TestReviewTestCaseService {
|
|||
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) {
|
||||
checkReviewer(request.getReviewId());
|
||||
ServiceUtils.getSelectAllIds(request, request.getCondition(),
|
||||
(query) -> extTestReviewCaseMapper.selectIds((QueryCaseReviewRequest) query));
|
||||
|
||||
|
|
Loading…
Reference in New Issue