-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11215 from fcfang123/issue-11138
feat:用户个人视角 权限管理优化 #11138
- Loading branch information
Showing
107 changed files
with
5,818 additions
and
1,670 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
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
112 changes: 112 additions & 0 deletions
112
...uth/api-auth/src/main/kotlin/com/tencent/devops/auth/api/user/UserAuthHandoverResource.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,112 @@ | ||
package com.tencent.devops.auth.api.user | ||
|
||
import com.tencent.devops.auth.pojo.request.HandoverDetailsQueryReq | ||
import com.tencent.devops.auth.pojo.request.HandoverOverviewBatchUpdateReq | ||
import com.tencent.devops.auth.pojo.request.HandoverOverviewQueryReq | ||
import com.tencent.devops.auth.pojo.request.HandoverOverviewUpdateReq | ||
import com.tencent.devops.auth.pojo.request.ResourceType2CountOfHandoverQuery | ||
import com.tencent.devops.auth.pojo.vo.HandoverAuthorizationDetailVo | ||
import com.tencent.devops.auth.pojo.vo.HandoverGroupDetailVo | ||
import com.tencent.devops.auth.pojo.vo.HandoverOverviewVo | ||
import com.tencent.devops.auth.pojo.vo.ResourceType2CountVo | ||
import com.tencent.devops.common.api.auth.AUTH_HEADER_USER_ID | ||
import com.tencent.devops.common.api.auth.AUTH_HEADER_USER_ID_DEFAULT_VALUE | ||
import com.tencent.devops.common.api.model.SQLPage | ||
import com.tencent.devops.common.api.pojo.Result | ||
import com.tencent.devops.common.auth.api.pojo.ResourceAuthorizationHandoverConditionRequest | ||
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.HeaderParam | ||
import javax.ws.rs.POST | ||
import javax.ws.rs.Path | ||
import javax.ws.rs.PathParam | ||
import javax.ws.rs.Produces | ||
import javax.ws.rs.core.MediaType | ||
|
||
@Tag(name = "USER_RESOURCE_AUTHORIZATION", description = "用户-权限-交接相关") | ||
@Path("/user/auth/handover/") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
interface UserAuthHandoverResource { | ||
@POST | ||
@Path("/{projectId}/handoverAuthorizationsApplication") | ||
@Operation(summary = "交接授权申请") | ||
fun handoverAuthorizationsApplication( | ||
@Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "项目ID", required = true) | ||
@PathParam("projectId") | ||
projectId: String, | ||
@Parameter(description = "资源授权交接条件实体", required = true) | ||
condition: ResourceAuthorizationHandoverConditionRequest | ||
): Result<String> | ||
|
||
@POST | ||
@Path("/listHandoverOverviews") | ||
@Operation(summary = "权限交接总览列表") | ||
fun listHandoverOverviews( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "权限交接总览查询", required = true) | ||
queryRequest: HandoverOverviewQueryReq | ||
): Result<SQLPage<HandoverOverviewVo>> | ||
|
||
@POST | ||
@Path("/getResourceType2CountOfHandover") | ||
@Operation(summary = "获取资源授权管理数量") | ||
fun getResourceType2CountOfHandover( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "查询请求体", required = true) | ||
queryReq: ResourceType2CountOfHandoverQuery | ||
): Result<List<ResourceType2CountVo>> | ||
|
||
@POST | ||
@Path("/listAuthorizationsOfHandover") | ||
@Operation(summary = "获取交接单中授权相关") | ||
fun listAuthorizationsOfHandover( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "权限交接详细查询请求体", required = true) | ||
queryReq: HandoverDetailsQueryReq | ||
): Result<SQLPage<HandoverAuthorizationDetailVo>> | ||
|
||
@POST | ||
@Path("/listGroupsOfHandover") | ||
@Operation(summary = "获取交接单中用户组相关") | ||
fun listGroupsOfHandover( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "权限交接详细查询请求体", required = true) | ||
queryReq: HandoverDetailsQueryReq | ||
): Result<SQLPage<HandoverGroupDetailVo>> | ||
|
||
@POST | ||
@Path("/handleHanoverApplication") | ||
@Operation(summary = "处理交接审批单") | ||
fun handleHanoverApplication( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "更新权限交接总览请求体", required = true) | ||
request: HandoverOverviewUpdateReq | ||
): Result<Boolean> | ||
|
||
@POST | ||
@Path("/batchHandleHanoverApplications") | ||
@Operation(summary = "批量处理交接审批单") | ||
fun batchHandleHanoverApplications( | ||
@Parameter(description = "用户名", required = true) | ||
@HeaderParam(AUTH_HEADER_USER_ID) | ||
userId: String, | ||
@Parameter(description = "批量更新权限交接总览请求体", required = true) | ||
request: HandoverOverviewBatchUpdateReq | ||
): Result<Boolean> | ||
} |
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
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
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
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
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
20 changes: 20 additions & 0 deletions
20
.../core/auth/api-auth/src/main/kotlin/com/tencent/devops/auth/pojo/dto/HandoverDetailDTO.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,20 @@ | ||
package com.tencent.devops.auth.pojo.dto | ||
|
||
import com.tencent.devops.auth.pojo.enum.HandoverType | ||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Schema(title = "权限交接详细表") | ||
data class HandoverDetailDTO( | ||
@get:Schema(title = "项目ID") | ||
val projectCode: String, | ||
@get:Schema(title = "流程单号") | ||
var flowNo: String? = null, | ||
@get:Schema(title = "授权/组ID") | ||
val itemId: String, | ||
@get:Schema(title = "组/授权资源关联的资源类型") | ||
val resourceType: String, | ||
@get:Schema(title = "交接类型") | ||
val handoverType: HandoverType, | ||
@get:Schema(title = "审批人") | ||
var approver: String? = null | ||
) |
Oops, something went wrong.