fix(接口测试): 替换分享接口权限
This commit is contained in:
parent
2abb563b65
commit
c8be0606e0
|
@ -264,6 +264,7 @@ public class PermissionConstants {
|
||||||
public static final String PROJECT_API_DEFINITION_IMPORT = "PROJECT_API_DEFINITION:READ+IMPORT";
|
public static final String PROJECT_API_DEFINITION_IMPORT = "PROJECT_API_DEFINITION:READ+IMPORT";
|
||||||
public static final String PROJECT_API_DEFINITION_EXPORT = "PROJECT_API_DEFINITION:READ+EXPORT";
|
public static final String PROJECT_API_DEFINITION_EXPORT = "PROJECT_API_DEFINITION:READ+EXPORT";
|
||||||
public static final String PROJECT_API_DEFINITION_EXECUTE = "PROJECT_API_DEFINITION:READ+EXECUTE";
|
public static final String PROJECT_API_DEFINITION_EXECUTE = "PROJECT_API_DEFINITION:READ+EXECUTE";
|
||||||
|
public static final String PROJECT_API_DEFINITION_SHARE = "PROJECT_API_DEFINITION:READ+SHARE";
|
||||||
public static final String PROJECT_API_DEFINITION_CASE_READ = "PROJECT_API_DEFINITION_CASE:READ";
|
public static final String PROJECT_API_DEFINITION_CASE_READ = "PROJECT_API_DEFINITION_CASE:READ";
|
||||||
public static final String PROJECT_API_DEFINITION_CASE_ADD = "PROJECT_API_DEFINITION_CASE:READ+ADD";
|
public static final String PROJECT_API_DEFINITION_CASE_ADD = "PROJECT_API_DEFINITION_CASE:READ+ADD";
|
||||||
public static final String PROJECT_API_DEFINITION_CASE_UPDATE = "PROJECT_API_DEFINITION_CASE:READ+UPDATE";
|
public static final String PROJECT_API_DEFINITION_CASE_UPDATE = "PROJECT_API_DEFINITION_CASE:READ+UPDATE";
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class ApiDocShareController {
|
||||||
|
|
||||||
@PostMapping(value = "/page")
|
@PostMapping(value = "/page")
|
||||||
@Operation(summary = "接口测试-定义-分页获取分享列表")
|
@Operation(summary = "接口测试-定义-分页获取分享列表")
|
||||||
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_DOC_SHARE)
|
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_SHARE)
|
||||||
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
|
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
|
||||||
public Pager<List<ApiDocShareDTO>> page(@Validated @RequestBody ApiDocSharePageRequest request) {
|
public Pager<List<ApiDocShareDTO>> page(@Validated @RequestBody ApiDocSharePageRequest request) {
|
||||||
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
|
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
|
||||||
|
@ -58,7 +58,7 @@ public class ApiDocShareController {
|
||||||
|
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
@Operation(summary = "接口测试-定义-新增分享")
|
@Operation(summary = "接口测试-定义-新增分享")
|
||||||
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_DOC_SHARE)
|
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_SHARE)
|
||||||
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
|
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
|
||||||
@Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = ApiDocShareLogService.class)
|
@Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = ApiDocShareLogService.class)
|
||||||
public ApiDocShare add(@Validated({Created.class}) @RequestBody ApiDocShareEditRequest request) {
|
public ApiDocShare add(@Validated({Created.class}) @RequestBody ApiDocShareEditRequest request) {
|
||||||
|
@ -67,7 +67,7 @@ public class ApiDocShareController {
|
||||||
|
|
||||||
@PostMapping(value = "/update")
|
@PostMapping(value = "/update")
|
||||||
@Operation(summary = "接口测试-定义-更新分享")
|
@Operation(summary = "接口测试-定义-更新分享")
|
||||||
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_DOC_SHARE)
|
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_SHARE)
|
||||||
@CheckOwner(resourceId = "#request.getId()", resourceType = "api_doc_share")
|
@CheckOwner(resourceId = "#request.getId()", resourceType = "api_doc_share")
|
||||||
@Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = ApiDocShareLogService.class)
|
@Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = ApiDocShareLogService.class)
|
||||||
public ApiDocShare update(@Validated({Updated.class}) @RequestBody ApiDocShareEditRequest request) {
|
public ApiDocShare update(@Validated({Updated.class}) @RequestBody ApiDocShareEditRequest request) {
|
||||||
|
@ -77,7 +77,7 @@ public class ApiDocShareController {
|
||||||
@GetMapping("/delete/{id}")
|
@GetMapping("/delete/{id}")
|
||||||
@Operation(summary = "接口测试-定义-删除分享")
|
@Operation(summary = "接口测试-定义-删除分享")
|
||||||
@Parameter(name = "id", description = "分享ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED))
|
@Parameter(name = "id", description = "分享ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED))
|
||||||
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_DOC_SHARE)
|
@RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_SHARE)
|
||||||
@CheckOwner(resourceId = "#id", resourceType = "api_doc_share")
|
@CheckOwner(resourceId = "#id", resourceType = "api_doc_share")
|
||||||
@Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = ApiDocShareLogService.class)
|
@Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = ApiDocShareLogService.class)
|
||||||
public void delete(@PathVariable String id) {
|
public void delete(@PathVariable String id) {
|
||||||
|
|
|
@ -97,19 +97,6 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "PROJECT_API_DEFINITION_DOC",
|
|
||||||
"name": "permission.api_doc.name",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"id": "PROJECT_API_DEFINITION_DOC:READ"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "PROJECT_API_DEFINITION_DOC:READ+SHARE",
|
|
||||||
"name": "permission.api_doc.share"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "PROJECT_API_SCENARIO",
|
"id": "PROJECT_API_SCENARIO",
|
||||||
"name": "message.api_scenario_task",
|
"name": "message.api_scenario_task",
|
||||||
|
|
Loading…
Reference in New Issue