diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/PermissionConstants.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/PermissionConstants.java index 99d54b2930..42af698519 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/PermissionConstants.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/PermissionConstants.java @@ -61,36 +61,23 @@ public class PermissionConstants { public static final String SYSTEM_SERVICE_INTEGRATION_DELETE = "SYSTEM_SERVICE_INTEGRATION_READ:READ+DELETE"; /*------ end: SYSTEM_SERVICE_INTEGRATION ------*/ - + /*------ start: SYSTEM_SERVICE_INTEGRATION ------*/ public static final String SYSTEM_USER_READ = "SYSTEM_USER:READ"; - public static final String SYSTEM_USER_READ_ADD = "SYSTEM_USER:READ+ADD"; - public static final String SYSTEM_USER_READ_IMPORT = "SYSTEM_USER:READ+IMPORT"; - public static final String SYSTEM_USER_READ_UPDATE = "SYSTEM_USER:READ+UPDATE"; - public static final String SYSTEM_USER_READ_DELETE = "SYSTEM_USER:READ+DELETE"; - public static final String SYSTEM_USER_READ_UPDATE_PASSWORD = "SYSTEM_USER:READ+UPDATE_PASSWORD"; + public static final String SYSTEM_USER_ADD = "SYSTEM_USER:READ+ADD"; + public static final String SYSTEM_USER_IMPORT = "SYSTEM_USER:READ+IMPORT"; + public static final String SYSTEM_USER_UPDATE = "SYSTEM_USER:READ+UPDATE"; + public static final String SYSTEM_USER_DELETE = "SYSTEM_USER:READ+DELETE"; + /*------ end: SYSTEM_SERVICE_INTEGRATION ------*/ public static final String SYSTEM_TEST_RESOURCE_POOL_READ = "SYSTEM_TEST_RESOURCE_POOL:READ"; public static final String SYSTEM_TEST_RESOURCE_POOL_READ_ADD = "SYSTEM_TEST_RESOURCE_POOL:READ+ADD"; public static final String SYSTEM_TEST_RESOURCE_POOL_READ_UPDATE = "SYSTEM_TEST_RESOURCE_POOL:READ+UPDATE"; public static final String SYSTEM_TEST_RESOURCE_POOL_READ_DELETE = "SYSTEM_TEST_RESOURCE_POOL:READ+DELETE"; - public static final String SYSTEM_GROUP_READ = "SYSTEM_GROUP:READ"; - public static final String SYSTEM_GROUP_READ_ADD = "SYSTEM_GROUP:READ+ADD"; - public static final String SYSTEM_GROUP_READ_UPDATE = "SYSTEM_GROUP:READ+UPDATE"; - public static final String SYSTEM_GROUP_READ_SETTING_PERMISSION = "SYSTEM_GROUP:READ+SETTING_PERMISSION"; - public static final String SYSTEM_GROUP_READ_DELETE = "SYSTEM_GROUP:READ+DELETE"; - - public static final String SYSTEM_SETTING_READ = "SYSTEM_SETTING:READ"; - public static final String SYSTEM_SETTING_READ_UPDATE = "SYSTEM_SETTING:READ+UPDATE"; - public static final String SYSTEM_SETTING_READ_CREAT = "SYSTEM_SETTING:READ+CREAT"; - public static final String SYSTEM_SETTING_READ_DELETE = "SYSTEM_SETTING:READ+DELETE"; - public static final String SYSTEM_SETTING_READ_AUTH_MANAGE = "SYSTEM_SETTING:READ+AUTH_MANAGE"; /*------ start: SYSTEM_PARAMETER_SETTING ------*/ public static final String SYSTEM_PARAMETER_SETTING_BASE_READ = "SYSTEM_PARAMETER_SETTING_BASE:READ"; public static final String SYSTEM_PARAMETER_SETTING_BASE_READ_UPDATE = "SYSTEM_PARAMETER_SETTING_BASE:READ+UPDATE"; - public static final String SYSTEM_PARAMETER_SETTING_DISPLAY_READ = "SYSTEM_PARAMETER_SETTING_DISPLAY:READ"; - public static final String SYSTEM_PARAMETER_SETTING_DISPLAY_READ_UPDATE = "SYSTEM_PARAMETER_SETTING_DISPLAY:READ+UPDATE"; public static final String SYSTEM_PARAMETER_SETTING_AUTH_READ = "SYSTEM_PARAMETER_SETTING_AUTH:READ"; public static final String SYSTEM_PARAMETER_SETTING_AUTH_READ_ADD = "SYSTEM_PARAMETER_SETTING_AUTH:READ+ADD"; public static final String SYSTEM_PARAMETER_SETTING_AUTH_READ_UPDATE = "SYSTEM_PARAMETER_SETTING_AUTH:READ+UPDATE"; @@ -108,180 +95,21 @@ public class PermissionConstants { public static final String PROJECT_MEMBER_DELETE = "PROJECT_MEMBER:READ+DELETE"; /*------ end: PROJECT_MEMBER ------*/ - public static final String SYSTEM_QUOTA_READ = "SYSTEM_QUOTA:READ"; - public static final String SYSTEM_QUOTA_READ_UPDATE = "SYSTEM_QUOTA:READ+UPDATE"; public static final String SYSTEM_AUTH_READ = "SYSTEM_AUTH:READ"; public static final String SYSTEM_AUTH_READ_UPDATE = "SYSTEM_AUTH:READ+UPDATE"; public static final String SYSTEM_LOG_READ = "SYSTEM_LOG:READ"; - public static final String ORGANIZATION_SERVICE_READ = "ORGANIZATION_SERVICE:READ"; - public static final String ORGANIZATION_SERVICE_READ_UPDATE = "ORGANIZATION_SERVICE:READ+UPDATE"; - - public static final String ORGANIZATION_USER_READ = "ORGANIZATION_USER:READ"; - public static final String ORGANIZATION_USER_READ_ADD = "ORGANIZATION_USER:READ+ADD"; - public static final String ORGANIZATION_USER_READ_UPDATE = "ORGANIZATION_USER:READ+UPDATE"; - public static final String ORGANIZATION_USER_READ_DELETE = "ORGANIZATION_USER:READ+DELETE"; - - public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ = "ORGANIZATION_PROJECT_ENVIRONMENT:READ"; - public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_ADD = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+ADD"; - public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_UPDATE = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+UPDATE"; - public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_DELETE = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+DELETE"; - public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_COPY = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+COPY"; - public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_IMPORT = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+IMPORT"; - public static final String ORGANIZATION_PROJECT_ENVIRONMENT_READ_EXPORT = "ORGANIZATION_PROJECT_ENVIRONMENT:READ+EXPORT"; - public static final String ORGANIZATION_LOG_READ = "ORGANIZATION_LOG:READ"; - public static final String PROJECT_USER_READ = "PROJECT_USER:READ"; public static final String PROJECT_USER_READ_ADD = "PROJECT_USER:READ+ADD"; - public static final String PROJECT_USER_READ_UPDATE = "PROJECT_USER:READ+UPDATE"; public static final String PROJECT_USER_READ_DELETE = "PROJECT_USER:READ+DELETE"; - public static final String PROJECT_MANAGER_READ = "PROJECT_MANAGER:READ"; - public static final String PROJECT_MANAGER_READ_ADD = "PROJECT_MANAGER:READ+ADD"; - public static final String PROJECT_MANAGER_READ_UPDATE = "PROJECT_MANAGER:READ+UPDATE"; - public static final String PROJECT_MANAGER_READ_DELETE = "PROJECT_MANAGER:READ+DELETE"; - - public static final String PROJECT_GROUP_READ = "PROJECT_GROUP:READ"; - public static final String PROJECT_GROUP_READ_ADD = "PROJECT_GROUP:READ+ADD"; - public static final String PROJECT_GROUP_READ_UPDATE = "PROJECT_GROUP:READ+UPDATE"; - public static final String PROJECT_GROUP_READ_DELETE = "PROJECT_GROUP:READ+DELETE"; - public static final String PROJECT_GROUP_READ_SETTING_PERMISSION = "PROJECT_GROUP:READ+SETTING_PERMISSION"; - - public static final String PROJECT_ENVIRONMENT_READ = "PROJECT_ENVIRONMENT:READ"; - public static final String PROJECT_ENVIRONMENT_READ_ADD = "PROJECT_ENVIRONMENT:READ+ADD"; - public static final String PROJECT_ENVIRONMENT_READ_UPDATE = "PROJECT_ENVIRONMENT:READ+UPDATE"; - public static final String PROJECT_ENVIRONMENT_READ_DELETE = "PROJECT_ENVIRONMENT:READ+DELETE"; - public static final String PROJECT_ENVIRONMENT_READ_COPY = "PROJECT_ENVIRONMENT:READ+COPY"; - public static final String PROJECT_ENVIRONMENT_READ_IMPORT = "PROJECT_ENVIRONMENT:READ+IMPORT"; - public static final String PROJECT_ENVIRONMENT_READ_EXPORT = "PROJECT_ENVIRONMENT:READ+EXPORT"; - - public static final String PROJECT_OPERATING_LOG_READ = "PROJECT_OPERATING_LOG:READ"; - - public static final String PROJECT_TRACK_CASE_READ = "PROJECT_TRACK_CASE:READ"; - public static final String PROJECT_TRACK_CASE_READ_ADD = "PROJECT_TRACK_CASE:READ+ADD"; - public static final String PROJECT_TRACK_CASE_READ_UPDATE = "PROJECT_TRACK_CASE:READ+UPDATE"; - public static final String PROJECT_TRACK_CASE_READ_DELETE = "PROJECT_TRACK_CASE:READ+DELETE"; - public static final String PROJECT_TRACK_CASE_MINDER_OPERATE = "PROJECT_TRACK_CASE_MINDER:OPERATE"; - public static final String PROJECT_TRACK_CASE_READ_COPY = "PROJECT_TRACK_CASE:READ+COPY"; - public static final String PROJECT_TRACK_CASE_READ_IMPORT = "PROJECT_TRACK_CASE:READ+IMPORT"; - public static final String PROJECT_TRACK_CASE_READ_EXPORT = "PROJECT_TRACK_CASE:READ+EXPORT"; - - public static final String PROJECT_TRACK_REVIEW_READ = "PROJECT_TRACK_REVIEW:READ"; - public static final String PROJECT_TRACK_REVIEW_READ_ADD = "PROJECT_TRACK_REVIEW:READ+ADD"; - public static final String PROJECT_TRACK_REVIEW_READ_UPDATE = "PROJECT_TRACK_REVIEW:READ+UPDATE"; - public static final String PROJECT_TRACK_REVIEW_READ_DELETE = "PROJECT_TRACK_REVIEW:READ+DELETE"; - public static final String PROJECT_TRACK_REVIEW_READ_COMMENT = "PROJECT_TRACK_REVIEW:READ+COMMENT"; - public static final String PROJECT_TRACK_REVIEW_READ_RELEVANCE_OR_CANCEL = "PROJECT_TRACK_REVIEW:READ+RELEVANCE_OR_CANCEL"; - - public static final String PROJECT_TRACK_PLAN_READ = "PROJECT_TRACK_PLAN:READ"; - public static final String PROJECT_TRACK_PLAN_READ_ADD = "PROJECT_TRACK_PLAN:READ+ADD"; - public static final String PROJECT_TRACK_PLAN_READ_UPDATE = "PROJECT_TRACK_PLAN:READ+UPDATE"; - public static final String PROJECT_TRACK_PLAN_READ_DELETE = "PROJECT_TRACK_PLAN:READ+DELETE"; - public static final String PROJECT_TRACK_PLAN_READ_BATCH_DELETE = "PROJECT_TRACK_PLAN:READ+BATCH_DELETE"; - public static final String PROJECT_TRACK_PLAN_READ_SCHEDULE = "PROJECT_TRACK_PLAN:READ+SCHEDULE"; - public static final String PROJECT_TRACK_PLAN_READ_RELEVANCE_OR_CANCEL = "PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL"; - public static final String PROJECT_TRACK_PLAN_READ_RUN = "PROJECT_TRACK_PLAN:READ+RUN"; - - public static final String PROJECT_TRACK_ISSUE_READ = "PROJECT_TRACK_ISSUE:READ"; - public static final String PROJECT_TRACK_ISSUE_READ_ADD = "PROJECT_TRACK_ISSUE:READ+ADD"; - public static final String PROJECT_TRACK_ISSUE_READ_UPDATE = "PROJECT_TRACK_ISSUE:READ+UPDATE"; - public static final String PROJECT_TRACK_ISSUE_READ_DELETE = "PROJECT_TRACK_ISSUE:READ+DELETE"; - - public static final String PROJECT_TRACK_REPORT_READ = "PROJECT_TRACK_REPORT:READ"; - public static final String PROJECT_TRACK_REPORT_READ_DELETE = "PROJECT_TRACK_REPORT:READ+DELETE"; - public static final String PROJECT_TRACK_REPORT_READ_UPDATE = "PROJECT_TRACK_REPORT:READ+UPDATE"; - public static final String PROJECT_TRACK_REPORT_READ_EXPORT = "PROJECT_TRACK_REPORT:READ+EXPORT"; - - public static final String PROJECT_API_DEFINITION_READ = "PROJECT_API_DEFINITION:READ"; public static final String PROJECT_API_DEFINITION_READ_ADD_API = "PROJECT_API_DEFINITION:READ+ADD_API"; - public static final String PROJECT_API_DEFINITION_READ_UPDATE_API = "PROJECT_API_DEFINITION:READ+UPDATE_API"; - public static final String PROJECT_API_DEFINITION_READ_DELETE_API = "PROJECT_API_DEFINITION:READ+DELETE_API"; - public static final String PROJECT_API_DEFINITION_READ_COPY_API = "PROJECT_API_DEFINITION:READ+COPY_API"; - public static final String PROJECT_API_DEFINITION_READ_ADD_CASE = "PROJECT_API_DEFINITION:READ+ADD_CASE"; - public static final String PROJECT_API_DEFINITION_READ_UPDATE_CASE = "PROJECT_API_DEFINITION:READ+UPDATE_CASE"; - public static final String PROJECT_API_DEFINITION_READ_DELETE_CASE = "PROJECT_API_DEFINITION:READ+DELETE_CASE"; - public static final String PROJECT_API_DEFINITION_READ_COPY_CASE = "PROJECT_API_DEFINITION:READ+COPY_CASE"; - public static final String PROJECT_API_DEFINITION_READ_IMPORT_API = "PROJECT_API_DEFINITION:READ+IMPORT_API"; - public static final String PROJECT_API_DEFINITION_READ_EXPORT_API = "PROJECT_API_DEFINITION:READ+EXPORT_API"; - public static final String PROJECT_API_DEFINITION_READ_ADD_PERFORMANCE = "PROJECT_API_DEFINITION:READ+ADD_PERFORMANCE"; - public static final String PROJECT_API_DEFINITION_READ_RUN = "PROJECT_API_DEFINITION:READ+RUN"; - public static final String PROJECT_API_DEFINITION_READ_DEBUG = "PROJECT_API_DEFINITION:READ+DEBUG"; - public static final String PROJECT_API_DEFINITION_READ_MOCK = "PROJECT_API_DEFINITION:READ+MOCK"; - - public static final String PROJECT_API_SCENARIO_READ = "PROJECT_API_SCENARIO:READ"; - public static final String PROJECT_API_SCENARIO_READ_ADD = "PROJECT_API_SCENARIO:READ+ADD"; - public static final String PROJECT_API_SCENARIO_READ_UPDATE = "PROJECT_API_SCENARIO:READ+UPDATE"; - public static final String PROJECT_API_SCENARIO_READ_DELETE = "PROJECT_API_SCENARIO:READ+DELETE"; - public static final String PROJECT_API_SCENARIO_READ_COPY = "PROJECT_API_SCENARIO:READ+COPY"; - public static final String PROJECT_API_SCENARIO_READ_RUN = "PROJECT_API_SCENARIO:READ+RUN"; - public static final String PROJECT_API_SCENARIO_READ_DEBUG = "PROJECT_API_SCENARIO:READ+DEBUG"; - public static final String PROJECT_API_SCENARIO_READ_SCHEDULE = "PROJECT_API_SCENARIO:READ+SCHEDULE"; - public static final String PROJECT_API_SCENARIO_READ_IMPORT_SCENARIO = "PROJECT_API_SCENARIO:READ+IMPORT_SCENARIO"; - public static final String PROJECT_API_SCENARIO_READ_EXPORT_SCENARIO = "PROJECT_API_SCENARIO:READ+EXPORT_SCENARIO"; - public static final String PROJECT_API_SCENARIO_READ_MOVE_BATCH = "PROJECT_API_SCENARIO:READ+MOVE_BATCH"; - public static final String PROJECT_API_SCENARIO_READ_ADD_PERFORMANCE = "PROJECT_API_SCENARIO:READ+ADD_PERFORMANCE"; - - public static final String PROJECT_UI_SCENARIO_READ = "PROJECT_UI_SCENARIO:READ"; - public static final String PROJECT_UI_SCENARIO_READ_ADD = "PROJECT_UI_SCENARIO:READ+ADD"; - public static final String PROJECT_UI_SCENARIO_READ_UPDATE = "PROJECT_UI_SCENARIO:READ+UPDATE"; - public static final String PROJECT_UI_SCENARIO_READ_DELETE = "PROJECT_UI_SCENARIO:READ+DELETE"; - public static final String PROJECT_UI_REPORT_READ_DELETE = "PROJECT_UI_REPORT:READ+DELETE"; - - public static final String PROJECT_UI_SCENARIO_READ_COPY = "PROJECT_UI_SCENARIO:READ+COPY"; - public static final String PROJECT_UI_SCENARIO_READ_RUN = "PROJECT_UI_SCENARIO:READ+RUN"; - public static final String PROJECT_UI_SCENARIO_READ_DEBUG = "PROJECT_UI_SCENARIO:READ+DEBUG"; - public static final String PROJECT_UI_SCENARIO_READ_SCHEDULE = "PROJECT_UI_SCENARIO:READ+SCHEDULE"; - public static final String PROJECT_UI_SCENARIO_READ_IMPORT_SCENARIO = "PROJECT_UI_SCENARIO:READ+IMPORT_SCENARIO"; - public static final String PROJECT_UI_SCENARIO_READ_EXPORT_SCENARIO = "PROJECT_UI_SCENARIO:READ+EXPORT_SCENARIO"; - public static final String PROJECT_UI_SCENARIO_READ_MOVE_BATCH = "PROJECT_UI_SCENARIO:READ+MOVE_BATCH"; - public static final String PROJECT_UI_SCENARIO_READ_ADD_PERFORMANCE = "PROJECT_UI_SCENARIO:READ+ADD_PERFORMANCE"; - - public static final String PROJECT_UI_ELEMENT_READ = "PROJECT_UI_SCENARIO:READ"; - public static final String PROJECT_UI_ELEMENT_READ_ADD = "PROJECT_UI_SCENARIO:READ+ADD"; - public static final String PROJECT_UI_ELEMENT_READ_UPDATE = "PROJECT_UI_SCENARIO:READ+UPDATE"; - public static final String PROJECT_UI_ELEMENT_READ_DELETE = "PROJECT_UI_SCENARIO:READ+DELETE"; - - public static final String PROJECT_API_REPORT_READ = "PROJECT_API_REPORT:READ"; public static final String PROJECT_API_REPORT_READ_DELETE = "PROJECT_API_REPORT:READ+DELETE"; - public static final String PROJECT_API_REPORT_READ_EXPORT = "PROJECT_API_REPORT:READ+EXPORT"; - - public static final String PROJECT_PERFORMANCE_TEST_READ = "PROJECT_PERFORMANCE_TEST:READ"; - public static final String PROJECT_PERFORMANCE_TEST_READ_ADD = "PROJECT_PERFORMANCE_TEST:READ+ADD"; - public static final String PROJECT_PERFORMANCE_TEST_READ_UPDATE = "PROJECT_PERFORMANCE_TEST:READ+UPDATE"; - public static final String PROJECT_PERFORMANCE_TEST_READ_DELETE = "PROJECT_PERFORMANCE_TEST:READ+DELETE"; - public static final String PROJECT_PERFORMANCE_TEST_READ_COPY = "PROJECT_PERFORMANCE_TEST:READ+COPY"; - public static final String PROJECT_PERFORMANCE_TEST_READ_RUN = "PROJECT_PERFORMANCE_TEST:READ+RUN"; - public static final String PROJECT_PERFORMANCE_TEST_READ_SCHEDULE = "PROJECT_PERFORMANCE_TEST:READ+SCHEDULE"; - - public static final String PROJECT_PERFORMANCE_REPORT_READ = "PROJECT_PERFORMANCE_REPORT:READ"; - public static final String PROJECT_PERFORMANCE_REPORT_READ_DELETE = "PROJECT_PERFORMANCE_REPORT:READ+DELETE"; - public static final String PROJECT_PERFORMANCE_REPORT_READ_EXPORT = "PROJECT_PERFORMANCE_REPORT:READ+EXPORT"; - - public static final String PROJECT_ENTERPRISE_REPORT_EXPORT = "PROJECT_ENTERPRISE_REPORT:READ+EXPORT"; - public static final String PROJECT_ENTERPRISE_REPORT_ADD = "PROJECT_ENTERPRISE_REPORT:READ+ADD"; - public static final String PROJECT_ENTERPRISE_REPORT_UPDATE = "PROJECT_ENTERPRISE_REPORT:READ+UPDATE"; - public static final String PROJECT_ENTERPRISE_REPORT_DELETE = "PROJECT_ENTERPRISE_REPORT:READ+DELETE"; - public static final String PROJECT_ENTERPRISE_REPORT_COPY = "PROJECT_ENTERPRISE_REPORT:READ+COPY"; - public static final String PROJECT_ENTERPRISE_REPORT_SCHEDULE = "PROJECT_ENTERPRISE_REPORT:READ+SCHEDULE"; - - public static final String PROJECT_FAKE_ERROR_EXPORT = "PROJECT_FAKE_ERROR:READ+EXPORT"; - public static final String PROJECT_FAKE_ERROR_ADD = "PROJECT_FAKE_ERROR:READ+ADD"; - public static final String PROJECT_FAKE_ERROR_UPDATE = "PROJECT_FAKE_ERROR:READ+UPDATE"; - public static final String PROJECT_FAKE_ERROR_DELETE = "PROJECT_FAKE_ERROR:READ+DELETE"; - public static final String PROJECT_FAKE_ERROR_COPY = "PROJECT_FAKE_ERROR:READ+COPY"; - public static final String PROJECT_FAKE_ERROR_SCHEDULE = "PROJECT_FAKE_ERROR:READ+SCHEDULE"; public static final String PROJECT_MESSAGE_READ = "PROJECT_MESSAGE:READ"; public static final String PROJECT_MESSAGE_READ_UPDATE = "PROJECT_MESSAGE:READ+UPDATE"; public static final String PROJECT_MESSAGE_READ_ADD = "PROJECT_MESSAGE:READ+ADD"; public static final String PROJECT_MESSAGE_READ_DELETE = "PROJECT_MESSAGE:READ+DELETE"; - - public static final String PROJECT_TEMPLATE_READ = "PROJECT_TEMPLATE:READ"; - public static final String PROJECT_TEMPLATE_READ_CASE_TEMPLATE = "PROJECT_TEMPLATE:READ+CASE_TEMPLATE"; - public static final String PROJECT_TEMPLATE_READ_ISSUE_TEMPLATE = "PROJECT_TEMPLATE:READ+ISSUE_TEMPLATE"; - public static final String PROJECT_TEMPLATE_READ_API_TEMPLATE = "PROJECT_TEMPLATE:READ+API_TEMPLATE"; - public static final String PROJECT_TEMPLATE_READ_CUSTOM = "PROJECT_TEMPLATE:READ+CUSTOM"; - public static final String PROJECT_TEMPLATE_READ_REPORT_TEMPLATE = "PROJECT_TEMPLATE:READ+REPORT_TEMPLATE"; } diff --git a/backend/framework/sdk/src/main/resources/i18n/system_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/system_en_US.properties index 3a8eb2b091..cd4f15c395 100644 --- a/backend/framework/sdk/src/main/resources/i18n/system_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/system_en_US.properties @@ -188,6 +188,7 @@ service_integration.configuration.not_blank=Service integration configuration ca # permission permission.system_plugin.name=Plugin permission.system_organization_project.name=Organization Project +permission.system_user.name=User permission.system_user_role.name=User role permission.system_test_resource_pool.name=Resource pool permission.system_parameter_setting.name=Parameter setting diff --git a/backend/framework/sdk/src/main/resources/i18n/system_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/system_zh_CN.properties index 0e895a82db..b9f3c97819 100644 --- a/backend/framework/sdk/src/main/resources/i18n/system_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/system_zh_CN.properties @@ -187,6 +187,7 @@ service_integration.configuration.not_blank=服务集成配置不能為空 # permission permission.system_plugin.name=插件 permission.system_organization_project.name=组织与项目 +permission.system_user.name=用户 permission.system_user_role.name=用户组 permission.system_test_resource_pool.name=资源池 permission.system_parameter_setting.name=参数设置 diff --git a/backend/framework/sdk/src/main/resources/i18n/system_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/system_zh_TW.properties index e8afb4cae1..19016d79d7 100644 --- a/backend/framework/sdk/src/main/resources/i18n/system_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/system_zh_TW.properties @@ -187,6 +187,7 @@ service_integration.configuration.not_blank=服务集成配置不能為空 # permission permission.system_plugin.name=插件 permission.system_organization_project.name=組織與項目 +permission.system_user.name=用戶 permission.system_user_role.name=用戶組 permission.system_test_resource_pool.name=資源池 permission.system_parameter_setting.name=參數設置 diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/UserController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/UserController.java index d254e99b78..1f662fc992 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/UserController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/UserController.java @@ -67,14 +67,14 @@ public class UserController { @PostMapping("/add") @Operation(summary = "系统设置-系统-用户-添加用户") - @RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_ADD) + @RequiresPermissions(PermissionConstants.SYSTEM_USER_ADD) public UserBatchCreateDTO addUser(@Validated({Created.class}) @RequestBody UserBatchCreateDTO userCreateDTO) { return userService.addUser(userCreateDTO, UserSource.LOCAL.name(), SessionUtils.getUserId()); } @PostMapping("/update") @Operation(summary = "系统设置-系统-用户-修改用户") - @RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_UPDATE) + @RequiresPermissions(PermissionConstants.SYSTEM_USER_UPDATE) @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = UserLogService.class) public UserEditRequest updateUser(@Validated({Updated.class}) @RequestBody UserEditRequest request) { return userService.updateUser(request, SessionUtils.getUserId()); @@ -91,7 +91,7 @@ public class UserController { @PostMapping("/update/enable") @Operation(summary = "系统设置-系统-用户-启用/禁用用户") - @RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_UPDATE) + @RequiresPermissions(PermissionConstants.SYSTEM_USER_UPDATE) @Log(type = OperationLogType.UPDATE, expression = "#msClass.batchUpdateEnableLog(#request)", msClass = UserLogService.class) public TableBatchProcessResponse updateUserEnable(@Validated @RequestBody UserChangeEnableRequest request) { return userService.updateUserEnable(request, SessionUtils.getSessionId()); @@ -99,7 +99,7 @@ public class UserController { @PostMapping(value = "/import", consumes = {"multipart/form-data"}) @Operation(summary = "系统设置-系统-用户-导入用户") - @RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_IMPORT) + @RequiresPermissions(PermissionConstants.SYSTEM_USER_IMPORT) public UserImportResponse importUser(@RequestPart(value = "file", required = false) MultipartFile excelFile) { return userService.importByExcel(excelFile, UserSource.LOCAL.name(), SessionUtils.getSessionId()); } @@ -107,14 +107,14 @@ public class UserController { @PostMapping("/delete") @Operation(summary = "系统设置-系统-用户-删除用户") @Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#request)", msClass = UserLogService.class) - @RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_DELETE) + @RequiresPermissions(PermissionConstants.SYSTEM_USER_DELETE) public TableBatchProcessResponse deleteUser(@Validated @RequestBody TableBatchProcessDTO request) { return userService.deleteUser(request, SessionUtils.getUserId()); } @PostMapping("/reset/password") @Operation(summary = "系统设置-系统-用户-重置用户密码") - @RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_UPDATE) + @RequiresPermissions(PermissionConstants.SYSTEM_USER_UPDATE) @Log(type = OperationLogType.UPDATE, expression = "#msClass.resetPasswordLog(#request)", msClass = UserLogService.class) public TableBatchProcessResponse resetPassword(@Validated @RequestBody TableBatchProcessDTO request) { return userService.resetPassword(request, SessionUtils.getUserId()); @@ -144,7 +144,7 @@ public class UserController { @PostMapping("/add/batch/user-role") @Operation(summary = "系统设置-系统-用户-批量添加用户到多个用户组中") - @RequiresPermissions(PermissionConstants.SYSTEM_USER_READ_UPDATE) + @RequiresPermissions(PermissionConstants.SYSTEM_USER_UPDATE) public TableBatchProcessResponse batchAddUserGroupRole(@Validated({Created.class}) @RequestBody UserRoleBatchRelationRequest request) { TableBatchProcessResponse returnResponse = globalUserRoleRelationService.batchAdd(request, SessionUtils.getUserId()); userLogService.batchAddUserRoleLog(request, SessionUtils.getUserId()); @@ -153,7 +153,7 @@ public class UserController { @PostMapping("/add-project-member") @Operation(summary = "系统设置-系统-用户-批量添加用户到项目") - @RequiresPermissions(value = {PermissionConstants.SYSTEM_USER_READ_UPDATE, PermissionConstants.SYSTEM_ORGANIZATION_PROJECT_MEMBER_ADD}, logical = Logical.AND) + @RequiresPermissions(value = {PermissionConstants.SYSTEM_USER_UPDATE, PermissionConstants.SYSTEM_ORGANIZATION_PROJECT_MEMBER_ADD}, logical = Logical.AND) public TableBatchProcessResponse addProjectMember(@Validated @RequestBody UserRoleBatchRelationRequest userRoleBatchRelationRequest) { ProjectAddMemberBatchRequest request = new ProjectAddMemberBatchRequest(); request.setProjectIds(userRoleBatchRelationRequest.getRoleIds()); @@ -165,7 +165,7 @@ public class UserController { @PostMapping("/add-org-member") @Operation(summary = "系统设置-系统-用户-批量添加用户到组织") - @RequiresPermissions(value = {PermissionConstants.SYSTEM_USER_READ_UPDATE, PermissionConstants.SYSTEM_ORGANIZATION_PROJECT_MEMBER_ADD}, logical = Logical.AND) + @RequiresPermissions(value = {PermissionConstants.SYSTEM_USER_UPDATE, PermissionConstants.SYSTEM_ORGANIZATION_PROJECT_MEMBER_ADD}, logical = Logical.AND) public TableBatchProcessResponse addMember(@Validated @RequestBody UserRoleBatchRelationRequest userRoleBatchRelationRequest) { //获取本次处理的用户 userRoleBatchRelationRequest.setSelectIds(userToolService.getBatchUserIds(userRoleBatchRelationRequest)); diff --git a/backend/services/system-setting/src/main/resources/permission.json b/backend/services/system-setting/src/main/resources/permission.json index 02ba8981d8..cbed3d1479 100644 --- a/backend/services/system-setting/src/main/resources/permission.json +++ b/backend/services/system-setting/src/main/resources/permission.json @@ -4,6 +4,27 @@ "name": "permission.system.name", "type": "SYSTEM", "children": [ + { + "id": "SYSTEM_USER", + "name": "permission.system_user.name", + "permissions": [ + { + "id": "SYSTEM_USER:READ" + }, + { + "id": "SYSTEM_USER:READ+ADD" + }, + { + "id": "SYSTEM_USER:READ+IMPORT" + }, + { + "id": "SYSTEM_USER:READ+UPDATE" + }, + { + "id": "SYSTEM_USER:READ+DELETE" + } + ] + }, { "id": "SYSTEM_ORGANIZATION_PROJECT", "name": "permission.system_organization_project.name", diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/user/UserControllerPermissionTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/user/UserControllerPermissionTests.java index c4210281f8..d89a875d3b 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/user/UserControllerPermissionTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/user/UserControllerPermissionTests.java @@ -46,7 +46,7 @@ public class UserControllerPermissionTests extends BaseTest { this.setName("member"); }}); }}; - this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_READ_ADD, UserRequestUtils.URL_USER_CREATE, UserParamUtils.getUserCreateDTO( + this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_ADD, UserRequestUtils.URL_USER_CREATE, UserParamUtils.getUserCreateDTO( paramRoleList, new ArrayList<>() {{ add(paramUserInfo); @@ -54,7 +54,7 @@ public class UserControllerPermissionTests extends BaseTest { )); //校验权限:修改用户 - this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_READ_UPDATE, UserRequestUtils.URL_USER_UPDATE, UserParamUtils.getUserUpdateDTO(paramUserInfo, paramRoleList)); + this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_UPDATE, UserRequestUtils.URL_USER_UPDATE, UserParamUtils.getUserUpdateDTO(paramUserInfo, paramRoleList)); //校验权限:分页查询用户列表 this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_READ, UserRequestUtils.URL_USER_PAGE, UserParamUtils.getDefaultPageRequest()); @@ -65,7 +65,7 @@ public class UserControllerPermissionTests extends BaseTest { userChangeEnableRequest.setSelectIds(new ArrayList<>() {{ this.add("admin"); }}); - this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_READ_UPDATE, UserRequestUtils.URL_USER_UPDATE_ENABLE, userChangeEnableRequest); + this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_UPDATE, UserRequestUtils.URL_USER_UPDATE_ENABLE, userChangeEnableRequest); //用户导入 File jarFile = new File( @@ -73,25 +73,25 @@ public class UserControllerPermissionTests extends BaseTest { MultiValueMap paramMap = new LinkedMultiValueMap<>(); paramMap.add("file", jarFile); - this.requestMultipartPermissionTest(PermissionConstants.SYSTEM_USER_READ_IMPORT, UserRequestUtils.URL_USER_IMPORT, paramMap); + this.requestMultipartPermissionTest(PermissionConstants.SYSTEM_USER_IMPORT, UserRequestUtils.URL_USER_IMPORT, paramMap); //用户删除 TableBatchProcessDTO request = new TableBatchProcessDTO(); request.setSelectIds(new ArrayList<>() {{ this.add("testId"); }}); - this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_READ_DELETE, UserRequestUtils.URL_USER_DELETE, request); + this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_DELETE, UserRequestUtils.URL_USER_DELETE, request); //重置密码 request = new TableBatchProcessDTO(); request.setSelectIds(Collections.singletonList("admin")); - this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_READ_UPDATE, UserRequestUtils.URL_USER_RESET_PASSWORD, request); + this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_UPDATE, UserRequestUtils.URL_USER_RESET_PASSWORD, request); //批量添加用户到用户组 UserRoleBatchRelationRequest userAndRoleBatchRequest = new UserRoleBatchRelationRequest(); userAndRoleBatchRequest.setSelectIds(Collections.singletonList("admin")); userAndRoleBatchRequest.setRoleIds(Collections.singletonList("member")); - this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_READ_UPDATE, UserRequestUtils.URL_USER_ROLE_RELATION, userAndRoleBatchRequest); + this.requestPostPermissionTest(PermissionConstants.SYSTEM_USER_UPDATE, UserRequestUtils.URL_USER_ROLE_RELATION, userAndRoleBatchRequest); //校验权限:系统全局用户组获取 @@ -106,7 +106,7 @@ public class UserControllerPermissionTests extends BaseTest { roleBatchRelationRequest.setSelectIds(Collections.singletonList("admin")); roleBatchRelationRequest.setRoleIds(Collections.singletonList("member")); List addMemberPermissionList = new ArrayList<>(); - addMemberPermissionList.add(PermissionConstants.SYSTEM_USER_READ_UPDATE); + addMemberPermissionList.add(PermissionConstants.SYSTEM_USER_UPDATE); addMemberPermissionList.add(PermissionConstants.SYSTEM_ORGANIZATION_PROJECT_MEMBER_ADD); this.requestPostPermissionsTest(addMemberPermissionList, UserRequestUtils.URL_ADD_PROJECT_MEMBER, roleBatchRelationRequest); // 批量添加用户到组织