fix(用例管理): 尝试修复用例评审详情页权限控制问题

--bug=1035964 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001035964
This commit is contained in:
guoyuqi 2024-02-22 19:05:16 +08:00 committed by Craftsman
parent eed6f82bcc
commit c5d4efe096
3 changed files with 4 additions and 3 deletions

View File

@ -186,7 +186,7 @@ CREATE TABLE IF NOT EXISTS functional_case_demand
( (
`id` VARCHAR(50) NOT NULL COMMENT 'ID', `id` VARCHAR(50) NOT NULL COMMENT 'ID',
`case_id` VARCHAR(50) NOT NULL COMMENT '功能用例ID', `case_id` VARCHAR(50) NOT NULL COMMENT '功能用例ID',
`parent` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '父需求id', `parent` VARCHAR(255) NOT NULL DEFAULT 'NONE' COMMENT '父需求id',
`demand_id` VARCHAR(255) COMMENT '需求ID', `demand_id` VARCHAR(255) COMMENT '需求ID',
`demand_name` VARCHAR(255) NOT NULL DEFAULT 'NONE' COMMENT '需求标题', `demand_name` VARCHAR(255) NOT NULL DEFAULT 'NONE' COMMENT '需求标题',
`demand_url` VARCHAR(255) COMMENT '需求地址', `demand_url` VARCHAR(255) COMMENT '需求地址',

View File

@ -35,6 +35,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -86,7 +87,7 @@ public class FunctionalCaseController {
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
@Operation(summary = "用例管理-功能用例-查看用例详情") @Operation(summary = "用例管理-功能用例-查看用例详情")
@RequiresPermissions(PermissionConstants.FUNCTIONAL_CASE_READ) @RequiresPermissions(value = {PermissionConstants.FUNCTIONAL_CASE_READ, PermissionConstants.CASE_REVIEW_READ}, logical = Logical.OR)
@CheckOwner(resourceId = "#id", resourceType = "functional_case") @CheckOwner(resourceId = "#id", resourceType = "functional_case")
public FunctionalCaseDetailDTO getFunctionalCaseDetail(@PathVariable String id) { public FunctionalCaseDetailDTO getFunctionalCaseDetail(@PathVariable String id) {
String userId = SessionUtils.getUserId(); String userId = SessionUtils.getUserId();

View File

@ -40,7 +40,7 @@ public class ReviewFunctionalCaseController {
@GetMapping("/get/list/{reviewId}/{caseId}") @GetMapping("/get/list/{reviewId}/{caseId}")
@Operation(summary = "用例管理-用例评审-评审功能用例-获取用例评审历史") @Operation(summary = "用例管理-用例评审-评审功能用例-获取用例评审历史")
@RequiresPermissions(PermissionConstants.FUNCTIONAL_CASE_READ) @RequiresPermissions(PermissionConstants.CASE_REVIEW_READ)
public List<CaseReviewHistoryDTO> getCaseReviewHistoryList(@PathVariable String reviewId, @PathVariable String caseId) { public List<CaseReviewHistoryDTO> getCaseReviewHistoryList(@PathVariable String reviewId, @PathVariable String caseId) {
return reviewFunctionalCaseService.getCaseReviewHistoryList(reviewId, caseId); return reviewFunctionalCaseService.getCaseReviewHistoryList(reviewId, caseId);
} }