fix(系统设置): 接口定义页面权限问题

--bug=1016064 --user=李玉号 【系统设置】权限管理,有接口定义查询和执行的权限,进入接口测试模块会跳到个人信息页面
https://www.tapd.cn/55049933/s/1232528
This commit is contained in:
shiziyuan9527 2022-08-24 15:13:02 +08:00 committed by lyh
parent 04bcd6bc37
commit 564840def2
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package io.metersphere.api.controller;
import io.metersphere.api.service.ApiDefinitionEnvService; import io.metersphere.api.service.ApiDefinitionEnvService;
import io.metersphere.base.domain.ApiDefinitionEnv; import io.metersphere.base.domain.ApiDefinitionEnv;
import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.constants.PermissionConstants;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -20,7 +21,7 @@ public class ApiDefinitionEnvController {
} }
@PostMapping(value = "/create") @PostMapping(value = "/create")
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_API) @RequiresPermissions(value = {PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_API, PermissionConstants.PROJECT_API_DEFINITION_READ}, logical = Logical.OR)
public void create(@RequestBody ApiDefinitionEnv request) { public void create(@RequestBody ApiDefinitionEnv request) {
apiDefinitionEnvService.insert(request); apiDefinitionEnvService.insert(request);
} }