From 1c0ee77b2f8214cad252444a99139fa846262013 Mon Sep 17 00:00:00 2001 From: greysonfang Date: Tue, 25 Jul 2023 11:28:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5RBAC=E6=9D=83=E9=99=90?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20#9149?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devops/auth/service/migrate/MigrateV0PolicyService.kt | 4 ++-- .../test/resources/v0/expected/group_web_policy_custom.json | 2 ++ .../src/test/resources/v0/group_web_policy_custom.json | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backend/ci/core/auth/biz-auth-rbac/src/main/kotlin/com/tencent/devops/auth/service/migrate/MigrateV0PolicyService.kt b/src/backend/ci/core/auth/biz-auth-rbac/src/main/kotlin/com/tencent/devops/auth/service/migrate/MigrateV0PolicyService.kt index 99782e82fc8..562d3c69e6c 100644 --- a/src/backend/ci/core/auth/biz-auth-rbac/src/main/kotlin/com/tencent/devops/auth/service/migrate/MigrateV0PolicyService.kt +++ b/src/backend/ci/core/auth/biz-auth-rbac/src/main/kotlin/com/tencent/devops/auth/service/migrate/MigrateV0PolicyService.kt @@ -216,10 +216,10 @@ class MigrateV0PolicyService constructor( logger.info("skip $action action") rbacActions.remove(action) } - certActions.contains(action) && !actions.contains(CERT_VIEW) -> { + certActions.contains(action) && !rbacActions.contains(CERT_VIEW) -> { rbacActions.add(CERT_VIEW) } - envNodeActions.contains(action) && !actions.contains(ENV_NODE_VIEW) -> { + envNodeActions.contains(action) && !rbacActions.contains(ENV_NODE_VIEW) -> { rbacActions.add(ENV_NODE_VIEW) } } diff --git a/src/backend/ci/core/auth/biz-auth-rbac/src/test/resources/v0/expected/group_web_policy_custom.json b/src/backend/ci/core/auth/biz-auth-rbac/src/test/resources/v0/expected/group_web_policy_custom.json index bd89b526f2a..5978e74cca4 100644 --- a/src/backend/ci/core/auth/biz-auth-rbac/src/test/resources/v0/expected/group_web_policy_custom.json +++ b/src/backend/ci/core/auth/biz-auth-rbac/src/test/resources/v0/expected/group_web_policy_custom.json @@ -59,6 +59,8 @@ "system" : "bk_ci_rbac", "actions" : [ { "id" : "env_node_use" + },{ + "id" : "env_node_edit" },{ "id" : "env_node_view" }], diff --git a/src/backend/ci/core/auth/biz-auth-rbac/src/test/resources/v0/group_web_policy_custom.json b/src/backend/ci/core/auth/biz-auth-rbac/src/test/resources/v0/group_web_policy_custom.json index 30ff5471f64..0d67b2b50ed 100644 --- a/src/backend/ci/core/auth/biz-auth-rbac/src/test/resources/v0/group_web_policy_custom.json +++ b/src/backend/ci/core/auth/biz-auth-rbac/src/test/resources/v0/group_web_policy_custom.json @@ -69,6 +69,9 @@ "actions": [ { "id": "env_node_use" + }, + { + "id": "env_node_edit" } ], "resources": [