Skip to content

Commit

Permalink
fix: NodeSearch权限校验失败 #2724
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoxuwan committed Oct 31, 2024
1 parent e223ea0 commit 8dee25e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import com.tencent.bkrepo.repository.pojo.node.NodeInfo
import com.tencent.bkrepo.repository.pojo.repo.RepoListOption
import com.tencent.bkrepo.common.metadata.service.repo.RepositoryService
import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.listPermissionPaths
import com.tencent.bkrepo.common.service.util.HttpContextHolder
import org.slf4j.LoggerFactory
import org.springframework.context.annotation.Conditional
import org.springframework.data.mongodb.core.query.Criteria
Expand Down Expand Up @@ -217,7 +218,7 @@ class RepoNameRuleInterceptor(
repoName: String,
repoPublic: Boolean? = null
): Boolean {
if (SecurityUtils.isServiceRequest()) {
if (HttpContextHolder.getRequestOrNull() == null || SecurityUtils.isServiceRequest()) {
return true
}
return try {
Expand Down

0 comments on commit 8dee25e

Please sign in to comment.