Skip to content

Commit

Permalink
feat: 目录权限支持绑定用户组 TencentBlueKing#1664
Browse files Browse the repository at this point in the history
* feat:新增用户组管理 TencentBlueKing#1649

* feat:新增用户组管理 TencentBlueKing#1649

* feat:新增用户组管理 TencentBlueKing#1649

* feat:新增用户组管理 TencentBlueKing#1649

* feat:新增用户组管理 TencentBlueKing#1649

* feat:新增用户组管理 TencentBlueKing#1649

* feat:新增用户组管理 TencentBlueKing#1649

* feat:新增用户组管理 TencentBlueKing#1649

* feat: 目录权限支持绑定用户组 TencentBlueKing#1664

* feat: 目录权限支持绑定用户组 TencentBlueKing#1664

* feat: 目录权限支持绑定用户组 TencentBlueKing#1664

* feat: 目录权限支持绑定用户组 TencentBlueKing#1664

---------

Co-authored-by: lannoy0523 <[email protected]>
  • Loading branch information
owenlxu and lannoy0523 authored Jan 19, 2024
1 parent b42bb33 commit 6451bed
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,17 @@ open class PermissionServiceImpl constructor(
repoName,
)

return getNoPermissionPathFromConfig(userId, user.roles, projectPermission)
}

private fun getNoPermissionPathFromConfig(
userId: String,
roles: List<String>,
config: List<TPermission>
): List<String> {
val excludePath = mutableListOf<String>()
val includePath = mutableListOf<String>()
projectPermission.forEach {
config.forEach {
if (it.users.contains(userId)) {
if (it.excludePattern.isNotEmpty()) {
excludePath.addAll(it.excludePattern)
Expand All @@ -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)
Expand Down

0 comments on commit 6451bed

Please sign in to comment.