From bad97e06e4dd23420300b556ffe7a84b8d76af96 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Tue, 30 Jan 2024 15:09:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F):=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=86=85=E5=AD=98=E6=B8=85=E7=90=86=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql | 1 + .../io/metersphere/sdk/constants/PermissionConstants.java | 2 ++ .../sdk/src/main/resources/i18n/system_en_US.properties | 2 ++ .../sdk/src/main/resources/i18n/system_zh_CN.properties | 2 ++ .../sdk/src/main/resources/i18n/system_zh_TW.properties | 2 ++ .../system/controller/SystemParameterController.java | 3 ++- .../system-setting/src/main/resources/permission.json | 8 ++++++++ 7 files changed, 19 insertions(+), 1 deletion(-) diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql index b7d4363f39..8a5e30b3ab 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/dml/V3.0.0_11_1__data.sql @@ -33,6 +33,7 @@ INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'member', 'SYSTEM_PARAMETER_SETTING_BASE:READ'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'member', 'SYSTEM_PARAMETER_SETTING_DISPLAY:READ'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'member', 'SYSTEM_PARAMETER_SETTING_AUTH:READ'); +INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'member', 'SYSTEM_PARAMETER_SETTING_MEMORY_CLEAN:READ'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'member', 'SYSTEM_AUTH:READ'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'member', 'SYSTEM_LOG:READ'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'member', 'SYSTEM_PERSONAL_API_KEY:READ+ADD'); 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 3cbb53ae4e..3bf7760335 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 @@ -85,6 +85,8 @@ public class PermissionConstants { public static final String SYSTEM_PARAMETER_SETTING_AUTH_READ_DELETE = "SYSTEM_PARAMETER_SETTING_AUTH:READ+DELETE"; 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_MEMORY_CLEAN_READ = "SYSTEM_PARAMETER_SETTING_MEMORY_CLEAN:READ"; + public static final String SYSTEM_PARAMETER_SETTING_MEMORY_CLEAN_READ_UPDATE = "SYSTEM_PARAMETER_SETTING_MEMORY_CLEAN:READ+UPDATE"; /*------ end: SYSTEM_PARAMETER_SETTING ------*/ 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 5d84b957e4..e5374726a6 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 @@ -240,6 +240,8 @@ permission.system_parameter_setting_auth.read=Auth parameter setting read permission.system_parameter_setting_auth.add=Auth parameter setting create permission.system_parameter_setting_auth.update=Auth parameter setting update permission.system_parameter_setting_auth.delete=Auth parameter setting delete +permission.system_parameter_setting_memory_clean.read=Memory clean parameter setting read +permission.system_parameter_setting_memory_clean.update=Memory clean parameter setting update permission.organization_user_role.name=User group permission.organization_member.name=User permission.service_integration.name=Service Integration 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 b55a48fd55..94ffb656e6 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 @@ -241,6 +241,8 @@ permission.system_parameter_setting_auth.read=认证设置-查询 permission.system_parameter_setting_auth.add=认证设置-创建 permission.system_parameter_setting_auth.update=认证设置-编辑 permission.system_parameter_setting_auth.delete=认证设置-删除 +permission.system_parameter_setting_memory_clean.read=内存清理-查询 +permission.system_parameter_setting_memory_clean.update=内存清理-编辑 permission.organization_user_role.name=用户组 permission.organization_member.name=用户 permission.service_integration.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 4d235768f3..0de23e6935 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 @@ -240,6 +240,8 @@ permission.system_parameter_setting_auth.read=認證設置-查詢 permission.system_parameter_setting_auth.add=認證設置-創建 permission.system_parameter_setting_auth.update=認證設置-編輯 permission.system_parameter_setting_auth.delete=認證設置-刪除 +permission.system_parameter_setting_memory_clean.read=內存清理-查詢 +permission.system_parameter_setting_memory_clean.update=內存清理-編輯 permission.organization_user_role.name=用戶組 permission.organization_member.name=用戶 permission.service_integration.name=服務集成 diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemParameterController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemParameterController.java index 17b505b275..00ff53bf1d 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemParameterController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemParameterController.java @@ -80,6 +80,7 @@ public class SystemParameterController { @PostMapping("/edit/clean-config") @Operation(summary = "系统设置-系统-系统参数-内存清理-保存") @Log(type = OperationLogType.UPDATE, expression = "#msClass.cleanOperationConfigLog(#systemParameter)", msClass = SystemParameterService.class) + @RequiresPermissions(PermissionConstants.SYSTEM_PARAMETER_SETTING_MEMORY_CLEAN_READ_UPDATE) public void editLogConfig(@RequestBody List systemParameter) { systemParameterService.editLogConfig(systemParameter); } @@ -87,7 +88,7 @@ public class SystemParameterController { @GetMapping("/get/clean-config") @Operation(summary = "系统设置-系统-系统参数-基本设置-内存清理-获取") - @RequiresPermissions(PermissionConstants.SYSTEM_PARAMETER_SETTING_BASE_READ) + @RequiresPermissions(PermissionConstants.SYSTEM_PARAMETER_SETTING_MEMORY_CLEAN_READ) public BaseCleanConfigDTO getLogConfigInfo() { return systemParameterService.getLogConfigInfo(); } diff --git a/backend/services/system-setting/src/main/resources/permission.json b/backend/services/system-setting/src/main/resources/permission.json index 6f8e769524..43ba1d168e 100644 --- a/backend/services/system-setting/src/main/resources/permission.json +++ b/backend/services/system-setting/src/main/resources/permission.json @@ -147,6 +147,14 @@ { "id": "SYSTEM_PARAMETER_SETTING_AUTH:READ+DELETE", "name": "permission.system_parameter_setting_auth.delete" + }, + { + "id": "SYSTEM_PARAMETER_SETTING_MEMORY_CLEAN:READ", + "name": "permission.system_parameter_setting_memory_clean.read" + }, + { + "id": "SYSTEM_PARAMETER_SETTING_MEMORY_CLEAN:READ+UPDATE", + "name": "permission.system_parameter_setting_memory_clean.update" } ] },