Skip to content

Commit

Permalink
fix(项目管理): 项目管理模块中的环境管理权限增加工作空间角色环境权限的支持
Browse files Browse the repository at this point in the history
--bug=1027180 --user=宋天阳 【项目设置】工作空间成员-赋予创建环境权限-但是无法创建成功
https://www.tapd.cn/55049933/s/1383469;--bug=1027175 --user=宋天阳
【项目设置】项目环境-复制环境-直接跳到了系统设置页面 https://www.tapd.cn/55049933/s/1383470
  • Loading branch information
Somebody-JIAN committed Jun 19, 2023
1 parent cb4b47b commit c30af4e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.metersphere.controller.request.EnvironmentRequest;
import io.metersphere.i18n.Translator;
import io.metersphere.log.annotation.MsAuditLog;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
Expand Down Expand Up @@ -66,15 +67,15 @@ public List<KeyStoreEntry> getEntry(@RequestPart("request") String password, @Re
}

@PostMapping("/add")
@RequiresPermissions(PermissionConstants.PROJECT_ENVIRONMENT_READ_CREATE)
@RequiresPermissions(value = {PermissionConstants.PROJECT_ENVIRONMENT_READ_CREATE, PermissionConstants.PROJECT_ENVIRONMENT_READ_COPY, PermissionConstants.WORKSPACE_PROJECT_ENVIRONMENT_READ_CREATE, PermissionConstants.WORKSPACE_PROJECT_ENVIRONMENT_READ_COPY}, logical = Logical.OR)
@MsAuditLog(module = OperLogModule.PROJECT_ENVIRONMENT_SETTING, type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#apiTestEnvironmentWithBLOBs.id)", msClass = ApiTestEnvironmentService.class)
public String create(@RequestPart("request") ApiTestEnvironmentDTO apiTestEnvironmentWithBLOBs, @RequestPart(value = "files", required = false) List<MultipartFile> sslFiles) {
checkParams(apiTestEnvironmentWithBLOBs);
return apiTestEnvironmentService.add(apiTestEnvironmentWithBLOBs, sslFiles);
}

@PostMapping(value = "/update")
@RequiresPermissions(PermissionConstants.PROJECT_ENVIRONMENT_READ_EDIT)
@RequiresPermissions(value = {PermissionConstants.PROJECT_ENVIRONMENT_READ_EDIT, PermissionConstants.WORKSPACE_PROJECT_ENVIRONMENT_READ_EDIT}, logical = Logical.OR)
@MsAuditLog(module = OperLogModule.PROJECT_ENVIRONMENT_SETTING, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#apiTestEnvironment.id)", content = "#msClass.getLogDetails(#apiTestEnvironment.id)", msClass = ApiTestEnvironmentService.class)
public void update(@RequestPart("request") ApiTestEnvironmentDTO apiTestEnvironment, @RequestPart(value = "files", required = false) List<MultipartFile> sslFiles) {
checkParams(apiTestEnvironment);
Expand Down

0 comments on commit c30af4e

Please sign in to comment.