Skip to content

Commit

Permalink
feat:活跃用户记录操作和次数 #10891
Browse files Browse the repository at this point in the history
  • Loading branch information
fcfang123 committed Sep 5, 2024
1 parent d1df00f commit d1fb92c
Showing 1 changed file with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ import com.tencent.devops.auth.pojo.vo.BatchOperateGroupMemberCheckVo
import com.tencent.devops.auth.pojo.vo.GroupDetailsInfoVo
import com.tencent.devops.auth.pojo.vo.MemberGroupCountWithPermissionsVo
import com.tencent.devops.auth.service.iam.PermissionResourceMemberService
import com.tencent.devops.auth.service.iam.PermissionService
import com.tencent.devops.common.api.model.SQLPage
import com.tencent.devops.common.api.pojo.Result
import com.tencent.devops.common.auth.api.AuthPermission
import com.tencent.devops.common.auth.api.AuthResourceType
import com.tencent.devops.common.auth.api.BkManagerCheck
import com.tencent.devops.common.web.RestResource

@RestResource
class UserAuthResourceMemberResourceImpl(
private val permissionResourceMemberService: PermissionResourceMemberService
private val permissionResourceMemberService: PermissionResourceMemberService,
private val permissionService: PermissionService
) : UserAuthResourceMemberResource {
@BkManagerCheck
override fun listProjectMembers(
userId: String,
projectId: String,
Expand All @@ -32,17 +35,27 @@ class UserAuthResourceMemberResourceImpl(
page: Int,
pageSize: Int
): Result<SQLPage<ResourceMemberInfo>> {
return Result(
permissionResourceMemberService.listProjectMembers(
projectCode = projectId,
memberType = memberType,
userName = userName,
deptName = deptName,
departedFlag = departedFlag ?: false,
page = page,
pageSize = pageSize
)
val hasVisitPermission = permissionService.validateUserResourcePermission(
userId = userId,
resourceType = AuthResourceType.PROJECT.value,
action = AuthPermission.VISIT.value,
projectCode = projectId
)
return if (!hasVisitPermission) {
Result(SQLPage(0, emptyList()))
} else {
Result(
permissionResourceMemberService.listProjectMembers(
projectCode = projectId,
memberType = memberType,
userName = userName,
deptName = deptName,
departedFlag = departedFlag ?: false,
page = page,
pageSize = pageSize
)
)
}
}

@BkManagerCheck
Expand Down

0 comments on commit d1fb92c

Please sign in to comment.