forked from TencentBlueKing/bk-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:支持管理员查看项目成员 TencentBlueKing#9620
- Loading branch information
Showing
14 changed files
with
506 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
...i-auth/src/main/kotlin/com/tencent/devops/auth/api/user/UserAuthResourceMemberResource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
package com.tencent.devops.auth.api.user | ||
|
||
import com.tencent.bk.sdk.iam.constants.ManagerScopesEnum | ||
import com.tencent.devops.auth.pojo.MemberInfo | ||
import com.tencent.devops.auth.pojo.dto.GroupMemberHandoverDTO | ||
import com.tencent.devops.auth.pojo.dto.GroupMemberRemoveDTO | ||
import com.tencent.devops.auth.pojo.dto.GroupMemberRenewalDTO | ||
import com.tencent.devops.common.api.auth.AUTH_HEADER_USER_ID | ||
import com.tencent.devops.common.api.pojo.Pagination | ||
import com.tencent.devops.common.api.pojo.Result | ||
import io.swagger.v3.oas.annotations.Operation | ||
import io.swagger.v3.oas.annotations.Parameter | ||
import io.swagger.v3.oas.annotations.tags.Tag | ||
import javax.ws.rs.Consumes | ||
import javax.ws.rs.DELETE | ||
import javax.ws.rs.GET | ||
import javax.ws.rs.HeaderParam | ||
import javax.ws.rs.PUT | ||
import javax.ws.rs.Path | ||
import javax.ws.rs.PathParam | ||
import javax.ws.rs.Produces | ||
import javax.ws.rs.QueryParam | ||
import javax.ws.rs.core.MediaType | ||
|
||
@Tag(name = "AUTH_RESOURCE_MEMBER", description = "用户态-iam用户") | ||
@Path("/user/auth/resource/member/{projectId}/") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
interface UserAuthResourceMemberResource { | ||
@GET | ||
@Path("/listProjectMembers") | ||
@Operation(summary = "获取项目下全体成员") | ||
@Suppress("LongParameterList") | ||
fun listProjectMembers( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "项目ID", required = true) | ||
@PathParam("projectId") | ||
projectId: String, | ||
@Parameter(description = "用户名称搜索") | ||
@QueryParam("userName") | ||
userName: String?, | ||
@Parameter(description = "组织搜索") | ||
@QueryParam("userName") | ||
deptName: String?, | ||
@Parameter(description = "第几页") | ||
@QueryParam("page") | ||
page: Int, | ||
@Parameter(description = "每页多少条") | ||
@QueryParam("pageSize") | ||
pageSize: Int | ||
): Result<Pagination<MemberInfo>> | ||
|
||
@PUT | ||
@Path("/batch/renewal") | ||
@Operation(summary = "批量续期组成员权限--无需进行审批") | ||
fun batchRenewalGroupMembers( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "项目ID", required = true) | ||
@PathParam("projectId") | ||
projectId: String, | ||
@Parameter(description = "批量续期成员请求实体") | ||
batchRenewalMemberDTO: List<GroupMemberRenewalDTO> | ||
): Result<Boolean> | ||
|
||
@DELETE | ||
@Path("/batch/remove") | ||
@Operation(summary = "批量移除用户组成员") | ||
fun batchRemoveGroupMembers( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "项目ID", required = true) | ||
@PathParam("projectId") | ||
projectId: String, | ||
@Parameter(description = "批量移除成员请求实体") | ||
batchRemoveMemberDTO: List<GroupMemberRemoveDTO> | ||
): Result<Boolean> | ||
|
||
@DELETE | ||
@Path("/batch/handover") | ||
@Operation(summary = "批量交接用户组成员") | ||
fun batchHandoverGroupMembers( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "项目ID", required = true) | ||
@PathParam("projectId") | ||
projectId: String, | ||
@Parameter(description = "批量交接成员请求实体") | ||
batchHandoverMemberDTO: List<GroupMemberHandoverDTO> | ||
): Result<Boolean> | ||
|
||
@DELETE | ||
@Path("/removeMemberFromProject") | ||
fun removeMemberFromProject( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "项目ID", required = true) | ||
@PathParam("projectId") | ||
projectId: String, | ||
@QueryParam("type") | ||
@Parameter(description = "成员类型") | ||
type: ManagerScopesEnum, | ||
@QueryParam("member") | ||
@Parameter(description = "组织ID/成员ID") | ||
member: String | ||
): Result<List<String>?> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
.../auth/api-auth/src/main/kotlin/com/tencent/devops/auth/pojo/dto/GroupMemberHandoverDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.devops.auth.pojo.dto | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Schema(title = "用户组成员交接") | ||
data class GroupMemberHandoverDTO( | ||
@get:Schema(title = "组ID") | ||
val groupId: Int, | ||
@get:Schema(title = "交接人") | ||
val handoverFrom: String, | ||
@get:Schema(title = "授予人") | ||
val handoverTo: String | ||
) |
38 changes: 38 additions & 0 deletions
38
...re/auth/api-auth/src/main/kotlin/com/tencent/devops/auth/pojo/dto/GroupMemberRemoveDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.devops.auth.pojo.dto | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Schema(title = "用户组成员移除") | ||
data class GroupMemberRemoveDTO( | ||
@get:Schema(title = "组成员") | ||
val member: String, | ||
@get:Schema(title = "组ID") | ||
val groupId: Int | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...end/ci/core/auth/api-auth/src/main/kotlin/com/tencent/devops/auth/pojo/enum/JoinedType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.devops.auth.pojo.enum | ||
|
||
enum class JoinedType { | ||
// 直接加入 | ||
DIRECT, | ||
|
||
// 通过模板加入 | ||
TEMPLATE | ||
} |
Oops, something went wrong.