refactor: adjustment project permission

This commit is contained in:
guoyuqi 2023-08-17 11:31:45 +08:00 committed by 刘瑞斌
parent 809af2ddd4
commit 205fb23978
5 changed files with 153 additions and 322 deletions

View File

@ -258,15 +258,18 @@ public class PermissionConstants {
public static final String PROJECT_ENTERPRISE_REPORT_COPY = "PROJECT_ENTERPRISE_REPORT:READ+COPY"; 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_ENTERPRISE_REPORT_SCHEDULE = "PROJECT_ENTERPRISE_REPORT:READ+SCHEDULE";
public static final String PROJECT_ERROR_REPORT_LIBRARY_EXPORT = "PROJECT_ERROR_REPORT_LIBRARY:READ+EXPORT"; public static final String PROJECT_FAKE_ERROR_EXPORT = "PROJECT_FAKE_ERROR:READ+EXPORT";
public static final String PROJECT_ERROR_REPORT_LIBRARY_ADD = "PROJECT_ERROR_REPORT_LIBRARY:READ+ADD"; public static final String PROJECT_FAKE_ERROR_ADD = "PROJECT_FAKE_ERROR:READ+ADD";
public static final String PROJECT_ERROR_REPORT_LIBRARY_UPDATE = "PROJECT_ERROR_REPORT_LIBRARY:READ+UPDATE"; public static final String PROJECT_FAKE_ERROR_UPDATE = "PROJECT_FAKE_ERROR:READ+UPDATE";
public static final String PROJECT_ERROR_REPORT_LIBRARY_DELETE = "PROJECT_ERROR_REPORT_LIBRARY:READ+DELETE"; public static final String PROJECT_FAKE_ERROR_DELETE = "PROJECT_FAKE_ERROR:READ+DELETE";
public static final String PROJECT_ERROR_REPORT_LIBRARY_COPY = "PROJECT_ERROR_REPORT_LIBRARY:READ+COPY"; public static final String PROJECT_FAKE_ERROR_COPY = "PROJECT_FAKE_ERROR:READ+COPY";
public static final String PROJECT_ERROR_REPORT_LIBRARY_SCHEDULE = "PROJECT_ERROR_REPORT_LIBRARY:READ+SCHEDULE"; 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 = "PROJECT_MESSAGE:READ";
public static final String PROJECT_MESSAGE_READ_UPDATE = "PROJECT_MESSAGE:READ+UPDATE"; 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 = "PROJECT_TEMPLATE:READ";
public static final String PROJECT_TEMPLATE_READ_CASE_TEMPLATE = "PROJECT_TEMPLATE:READ+CASE_TEMPLATE"; 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_ISSUE_TEMPLATE = "PROJECT_TEMPLATE:READ+ISSUE_TEMPLATE";

View File

@ -91,3 +91,12 @@ functional_case_template_extend.id.not_blank=ID is required
functional_case_template_extend.step_model.length_range=Step Model length must be between {min} and {max} functional_case_template_extend.step_model.length_range=Step Model length must be between {min} and {max}
functional_case_template_extend.step_model.not_blank=Step Model is required functional_case_template_extend.step_model.not_blank=Step Model is required
project_is_null=Project does not exist project_is_null=Project does not exist
# permission
permission.project_user.name=User
permission.project_group.name=User group
permission.project_environment.name=Environment config
permission.project_file.name=File management
permission.project_template.name=Template management
permission.project_message.name=Message management
permission.project_fake_error.name=Fake error

View File

@ -91,3 +91,11 @@ functional_case_template_extend.id.not_blank=ID不能为空
functional_case_template_extend.step_model.length_range=步骤模型长度必须在{min}-{max}之间 functional_case_template_extend.step_model.length_range=步骤模型长度必须在{min}-{max}之间
functional_case_template_extend.step_model.not_blank=步骤模型不能为空 functional_case_template_extend.step_model.not_blank=步骤模型不能为空
project_not_exist=项目不存在 project_not_exist=项目不存在
# permission
permission.project_user.name=用户
permission.project_group.name=用户组
permission.project_environment.name=环境配置
permission.project_file.name=文件管理
permission.project_template.name=模版管理
permission.project_message.name=消息管理
permission.project_fake_error.name=误报库

View File

@ -91,3 +91,11 @@ functional_case_template_extend.id.not_blank=ID不能為空
functional_case_template_extend.step_model.length_range=步驟模型長度必須在{min}-{max}之間 functional_case_template_extend.step_model.length_range=步驟模型長度必須在{min}-{max}之間
functional_case_template_extend.step_model.not_blank=步驟模型不能為空 functional_case_template_extend.step_model.not_blank=步驟模型不能為空
project_is_null=項目不存在 project_is_null=項目不存在
# permission
permission.project_user.name=用戶
permission.project_group.name=用戶組
permission.project_environment.name=環境配置
permission.project_file.name=文件管理
permission.project_template.name=模版管理
permission.project_message.name=消息管理
permission.project_fake_error.name=誤報庫

View File

@ -1,316 +1,119 @@
{ [
"permissions": [ {
{ "id": "PROJECT",
"id": "PROJECT_USER:READ", "name": "permission.project.name",
"name": "permission.project_user.read", "type": "PROJECT",
"resourceId": "PROJECT_USER" "children": [
}, {
{ "id": "PROJECT_USER",
"id": "PROJECT_USER:READ+ADD", "name": "permission.project_user.name",
"name": "permission.project_user.add", "permissions": [
"resourceId": "PROJECT_USER" {
}, "id": "PROJECT_USER:READ"
{ },
"id": "PROJECT_USER:READ+UPDATE", {
"name": "permission.project_user.update", "id": "PROJECT_USER:READ+ADD"
"resourceId": "PROJECT_USER" },
}, {
{ "id": "PROJECT_USER:READ+UPDATE"
"id": "PROJECT_USER:READ+DELETE", },
"name": "permission.project_user.delete", {
"resourceId": "PROJECT_USER" "id": "PROJECT_USER:READ+DELETE"
}, }
{ ]
"id": "PROJECT_GROUP:READ", },
"name": "permission.project_group.read", {
"resourceId": "PROJECT_GROUP" "id": "PROJECT_GROUP",
}, "name": "permission.project_group.name",
{ "permissions": [
"id": "PROJECT_GROUP:READ+ADD", {
"name": "permission.project_group.add", "id": "PROJECT_GROUP:READ"
"resourceId": "PROJECT_GROUP" },
}, {
{ "id": "PROJECT_GROUP:READ+ADD"
"id": "PROJECT_GROUP:READ+UPDATE", },
"name": "permission.project_group.update", {
"resourceId": "PROJECT_GROUP" "id": "PROJECT_GROUP:READ+UPDATE"
}, },
{ {
"id": "PROJECT_GROUP:READ+DELETE", "id": "PROJECT_GROUP:READ+DELETE"
"name": "permission.project_group.delete", }
"resourceId": "PROJECT_GROUP" ]
}, },
{ {
"id": "PROJECT_GROUP:READ+SETTING_PERMISSION", "id": "PROJECT_ENVIRONMENT",
"name": "permission.project_group.setting_permission", "name": "permission.project_environment.name",
"resourceId": "PROJECT_GROUP" "permissions": [
}, {
{ "id": "PROJECT_ENVIRONMENT:READ"
"id": "PROJECT_MANAGER:READ", },
"name": "permission.project_manager.read", {
"resourceId": "PROJECT_MANAGER" "id": "PROJECT_ENVIRONMENT:READ+ADD"
}, },
{ {
"id": "PROJECT_MANAGER:READ+UPDATE", "id": "PROJECT_ENVIRONMENT:READ+UPDATE"
"name": "permission.project_manager.update", },
"resourceId": "PROJECT_MANAGER" {
}, "id": "PROJECT_ENVIRONMENT:READ+DELETE"
{ }
"id": "PROJECT_APP_MANAGER:READ+UPDATE", ]
"name": "permission.project_app_manager.update", },
"resourceId": "PROJECT_APP_MANAGER" {
}, "id": "PROJECT_FILE",
{ "name": "permission.project_file.name",
"id": "PROJECT_ENVIRONMENT:READ", "permissions": [
"name": "permission.project_environment.read", {
"resourceId": "PROJECT_ENVIRONMENT" "id": "PROJECT_FILE:READ"
}, }
{ ]
"id": "PROJECT_ENVIRONMENT:READ+ADD", },
"name": "permission.project_environment.add", {
"resourceId": "PROJECT_ENVIRONMENT" "id": "PROJECT_TEMPLATE",
}, "name": "permission.project_template.name",
{ "permissions": [
"id": "PROJECT_ENVIRONMENT:READ+UPDATE", {
"name": "permission.project_environment.update", "id": "PROJECT_TEMPLATE:READ"
"resourceId": "PROJECT_ENVIRONMENT" }
}, ]
{ },
"id": "PROJECT_ENVIRONMENT:READ+DELETE", {
"name": "permission.project_environment.delete", "id": "PROJECT_MESSAGE",
"resourceId": "PROJECT_ENVIRONMENT" "name": "permission.project_message.name",
}, "permissions": [
{ {
"id": "PROJECT_ENVIRONMENT:READ+COPY", "id": "PROJECT_MESSAGE:READ"
"name": "permission.project_environment.copy", },
"resourceId": "PROJECT_ENVIRONMENT" {
}, "id": "PROJECT_MESSAGE:READ+ADD"
{ },
"id": "PROJECT_ENVIRONMENT:READ+IMPORT", {
"name": "permission.project_environment.import", "id": "PROJECT_MESSAGE:READ+UPDATE"
"resourceId": "PROJECT_ENVIRONMENT" },
}, {
{ "id": "PROJECT_MESSAGE:READ+DELETE"
"id": "PROJECT_ENVIRONMENT:READ+EXPORT", }
"name": "permission.project_environment.export", ]
"resourceId": "PROJECT_ENVIRONMENT" },
}, {
{ "id": "PROJECT_FAKE_ERROR",
"id": "PROJECT_OPERATING_LOG:READ", "name": "permission.project_fake_error.name",
"name": "permission.project_operation_log.read", "license": true,
"resourceId": "PROJECT_OPERATING_LOG" "permissions": [
}, {
{ "id": "PROJECT_FAKE_ERROR:READ"
"id": "PROJECT_FILE:READ",
"name": "permission.project_file.jar", },
"resourceId": "PROJECT_FILE" {
}, "id": "PROJECT_FAKE_ERROR:READ+ADD"
{ },
"id": "PROJECT_FILE:READ+UPLOAD+JAR", {
"name": "permission.project_file.upload_jar", "id": "PROJECT_FAKE_ERROR:READ+UPDATE"
"resourceId": "PROJECT_FILE" },
}, {
{ "id": "PROJECT_FAKE_ERROR:READ+DELETE"
"id": "PROJECT_FILE:READ+DOWNLOAD+JAR", }
"name": "permission.project_file.file_download", ]
"resourceId": "PROJECT_FILE" }
}, ]
{ }
"id": "PROJECT_FILE:READ+DELETE+JAR", ]
"name": "permission.project_file.delete_jar",
"resourceId": "PROJECT_FILE"
},
{
"id": "PROJECT_FILE:READ+BATCH+DELETE",
"name": "permission.project_file.batch_delete",
"resourceId": "PROJECT_FILE"
},
{
"id": "PROJECT_FILE:READ+BATCH+DOWNLOAD",
"name": "permission.project_file.batch_download",
"resourceId": "PROJECT_FILE"
},
{
"id": "PROJECT_FILE:READ+BATCH+MOVE",
"name": "permission.project_file.batch_move",
"resourceId": "PROJECT_FILE"
},
{
"id": "PROJECT_TEMPLATE:READ",
"name": "permission.project_template.read",
"resourceId": "PROJECT_TEMPLATE"
},
{
"id": "PROJECT_TEMPLATE:READ+CASE_TEMPLATE",
"name": "permission.project_template.case_template",
"resourceId": "PROJECT_TEMPLATE"
},
{
"id": "PROJECT_TEMPLATE:READ+ISSUE_TEMPLATE",
"name": "permission.project_template.issue_template",
"resourceId": "PROJECT_TEMPLATE"
},
{
"id": "PROJECT_TEMPLATE:READ+API_TEMPLATE",
"name": "permission.project_template.api_template",
"resourceId": "PROJECT_TEMPLATE"
},
{
"id": "PROJECT_TEMPLATE:READ+CUSTOM",
"name": "permission.project_template.custom",
"resourceId": "PROJECT_TEMPLATE"
},
{
"id": "PROJECT_MESSAGE:READ",
"name": "permission.project_message.read",
"resourceId": "PROJECT_MESSAGE"
},
{
"id": "PROJECT_MESSAGE:READ+UPDATE",
"name": "permission.project_message.update",
"resourceId": "PROJECT_MESSAGE"
},
{
"id": "PROJECT_MESSAGE:READ+DELETE",
"name": "permission.project_message.delete",
"resourceId": "PROJECT_MESSAGE"
},
{
"id": "PROJECT_CUSTOM_CODE:READ",
"name": "permission.project_custom_code.read",
"resourceId": "PROJECT_CUSTOM_CODE"
},
{
"id": "PROJECT_CUSTOM_CODE:READ+ADD",
"name": "permission.project_custom_code.add",
"resourceId": "PROJECT_CUSTOM_CODE"
},
{
"id": "PROJECT_CUSTOM_CODE:READ+UPDATE",
"name": "permission.project_custom_code.update",
"resourceId": "PROJECT_CUSTOM_CODE"
},
{
"id": "PROJECT_CUSTOM_CODE:READ+DELETE",
"name": "permission.project_custom_code.delete",
"resourceId": "PROJECT_CUSTOM_CODE"
},
{
"id": "PROJECT_CUSTOM_CODE:READ+COPY",
"name": "permission.project_custom_code.copy",
"resourceId": "PROJECT_CUSTOM_CODE"
},
{
"id": "PROJECT_VERSION:READ",
"name": "project.version.read",
"resourceId": "PROJECT_VERSION",
"license": true
},
{
"id": "PROJECT_VERSION:READ+ADD",
"name": "project.version.add_version",
"resourceId": "PROJECT_VERSION",
"license": true
},
{
"id": "PROJECT_VERSION:READ+UPDATE",
"name": "project.version.update_version",
"resourceId": "PROJECT_VERSION",
"license": true
},
{
"id": "PROJECT_VERSION:READ+DELETE",
"name": "project.version.delete_version",
"resourceId": "PROJECT_VERSION",
"license": true
},
{
"id": "PROJECT_VERSION:READ+ENABLE",
"name": "project.version.enable",
"resourceId": "PROJECT_VERSION",
"license": true
},
{
"id": "PROJECT_ERROR_REPORT_LIBRARY:READ",
"name": "permission.project_error_report_library.read",
"resourceId": "PROJECT_ERROR_REPORT_LIBRARY",
"license": true
},
{
"id": "PROJECT_ERROR_REPORT_LIBRARY:READ+ADD",
"name": "permission.project_error_report_library.add",
"resourceId": "PROJECT_ERROR_REPORT_LIBRARY",
"license": true
},
{
"id": "PROJECT_ERROR_REPORT_LIBRARY:READ+UPDATE",
"name": "permission.project_error_report_library.update",
"resourceId": "PROJECT_ERROR_REPORT_LIBRARY",
"license": true
},
{
"id": "PROJECT_ERROR_REPORT_LIBRARY:READ+DELETE",
"name": "permission.project_error_report_library.delete",
"resourceId": "PROJECT_ERROR_REPORT_LIBRARY",
"license": true
},
{
"id": "PROJECT_ERROR_REPORT_LIBRARY:READ+BATCH_DELETE",
"name": "permission.project_error_report_library.batch_delete",
"resourceId": "PROJECT_ERROR_REPORT_LIBRARY",
"license": true
}
],
"resource": [
{
"id": "PROJECT_USER",
"name": "permission.project_user.name"
},
{
"id": "PROJECT_MANAGER",
"name": "permission.project_manager.name"
},
{
"id": "PROJECT_GROUP",
"name": "permission.project_group.name"
},
{
"id": "PROJECT_ENVIRONMENT",
"name": "permission.project_environment.name"
},
{
"id": "PROJECT_OPERATING_LOG",
"name": "permission.project_operation_log.name"
},
{
"id": "PROJECT_CUSTOM_CODE",
"name": "permission.project_custom_code.name"
},
{
"id": "PROJECT_FILE",
"name": "permission.project_file.name"
},
{
"id": "PROJECT_TEMPLATE",
"name": "permission.project_template.name"
},
{
"id": "PROJECT_MESSAGE",
"name": "permission.project_message.name"
},
{
"id": "PROJECT_VERSION",
"name": "project.version_manage",
"license": true
},
{
"id": "PROJECT_ERROR_REPORT_LIBRARY",
"name": "permission.project_error_report_library.name",
"license": true
},
{
"id": "PROJECT_APP_MANAGER",
"name": "permission.project_app_manager.name"
}
]
}