From 6451bed68205c36fb6fafdf5720e333f16c21e2b Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 19 Jan 2024 19:40:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9B=AE=E5=BD=95=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=BB=91=E5=AE=9A=E7=94=A8=E6=88=B7=E7=BB=84?= =?UTF-8?q?=20#1664?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat:新增用户组管理 #1649 * feat:新增用户组管理 #1649 * feat:新增用户组管理 #1649 * feat:新增用户组管理 #1649 * feat:新增用户组管理 #1649 * feat:新增用户组管理 #1649 * feat:新增用户组管理 #1649 * feat:新增用户组管理 #1649 * feat: 目录权限支持绑定用户组 #1664 * feat: 目录权限支持绑定用户组 #1664 * feat: 目录权限支持绑定用户组 #1664 * feat: 目录权限支持绑定用户组 #1664 --------- Co-authored-by: lannoy0523 <935275025@qq.com> --- .../auth/service/local/PermissionServiceImpl.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/service/local/PermissionServiceImpl.kt b/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/service/local/PermissionServiceImpl.kt index 322b0c24ec..c49cf34e2e 100644 --- a/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/service/local/PermissionServiceImpl.kt +++ b/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/service/local/PermissionServiceImpl.kt @@ -417,9 +417,17 @@ open class PermissionServiceImpl constructor( repoName, ) + return getNoPermissionPathFromConfig(userId, user.roles, projectPermission) + } + + private fun getNoPermissionPathFromConfig( + userId: String, + roles: List, + config: List + ): List { val excludePath = mutableListOf() val includePath = mutableListOf() - projectPermission.forEach { + config.forEach { if (it.users.contains(userId)) { if (it.excludePattern.isNotEmpty()) { excludePath.addAll(it.excludePattern) @@ -433,7 +441,7 @@ open class PermissionServiceImpl constructor( } } - val interRole = it.roles.intersect(user.roles.toSet()) + val interRole = it.roles.intersect(roles.toSet()) if (interRole.isNotEmpty()) { if (it.excludePattern.isNotEmpty()) { excludePath.addAll(it.excludePattern)