Skip to content

Commit

Permalink
feat:用户个人视角 权限管理优化 #11138
Browse files Browse the repository at this point in the history
  • Loading branch information
fcfang123 committed Dec 5, 2024
1 parent 0cd7240 commit 6bbbd1e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.tencent.devops.auth.pojo.vo

import com.tencent.devops.auth.pojo.enum.HandoverStatus
import io.swagger.v3.oas.annotations.media.Schema
import java.time.LocalDateTime

@Schema(title = "权限交接总览返回体")
data class HandoverOverviewVo(
Expand All @@ -23,6 +24,8 @@ data class HandoverOverviewVo(
val groupCount: Int,
@get:Schema(title = "授权个数")
val authorizationCount: Int,
@get:Schema(title = "创建时间")
val createTime: LocalDateTime,
@get:Schema(title = "最后修改人")
val lastOperator: String? = null,
@get:Schema(title = "是否可以撤销,提单为当前用户并且单据处于审批中")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class AuthHandoverOverviewDao {
groupCount = groupCount,
authorizationCount = authorizationCount,
lastOperator = lastOperator,
createTime = createTime,
canRevoke = memberId?.let { memberId == applicant && status == HandoverStatus.PENDING.value },
canApproval = memberId?.let { memberId == approver && status == HandoverStatus.PENDING.value },
remark = remark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class RbacPermissionHandoverApplicationService(
override fun listHandoverOverviews(
queryRequest: HandoverOverviewQueryReq
): SQLPage<HandoverOverviewVo> {
logger.info("list handover overviews :$queryRequest")
val records = handoverOverviewDao.list(
dslContext = dslContext,
queryRequest = queryRequest
Expand All @@ -135,6 +136,7 @@ class RbacPermissionHandoverApplicationService(
override fun listAuthorizationsOfHandoverApplication(
queryReq: HandoverDetailsQueryReq
): SQLPage<HandoverAuthorizationDetailVo> {
logger.info("list authorizations of handover application :$queryReq")
val flowNo = queryReq.flowNo!!
val overview = getHandoverOverview(flowNo)
val resourceCodes = handoverDetailDao.list(
Expand Down Expand Up @@ -174,6 +176,7 @@ class RbacPermissionHandoverApplicationService(
override fun listGroupsOfHandoverApplication(
queryReq: HandoverDetailsQueryReq
): SQLPage<HandoverGroupDetailVo> {
logger.info("list groups of handover application :$queryReq")
val flowNo = queryReq.flowNo!!
val handoverOverview = getHandoverOverview(flowNo)
val iamGroupIdsByHandover = listHandoverDetails(
Expand Down Expand Up @@ -212,6 +215,7 @@ class RbacPermissionHandoverApplicationService(
}

override fun getResourceType2CountOfHandoverApplication(flowNo: String): List<ResourceType2CountVo> {
logger.info("get resource type count of handover application:$flowNo")
val handoverOverview = getHandoverOverview(flowNo)
val resourceType2CountWithGroup = handoverDetailDao.countWithResourceType(
dslContext = dslContext,
Expand Down Expand Up @@ -266,6 +270,7 @@ class RbacPermissionHandoverApplicationService(
handoverType: HandoverType,
resourceType: String?
): List<HandoverDetailDTO> {
logger.info("list member handover details:$projectCode|$memberId|$handoverType|$resourceType")
val handoverOverviews = listHandoverOverviews(
queryRequest = HandoverOverviewQueryReq(
memberId = memberId,
Expand Down

0 comments on commit 6bbbd1e

Please sign in to comment.