Skip to content

Commit

Permalink
[stream]github 审核权限优化 #7812
Browse files Browse the repository at this point in the history
  • Loading branch information
yongyiduan committed Oct 18, 2022
1 parent 60932c7 commit 304f57d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.tencent.devops.common.webhook.pojo.code.github.isPrForkNotMergeEvent
import com.tencent.devops.process.yaml.v2.enums.StreamMrEventAction
import com.tencent.devops.process.yaml.v2.enums.StreamObjectKind
import com.tencent.devops.process.yaml.v2.models.on.TriggerOn
import com.tencent.devops.repository.pojo.enums.GithubAccessLevelEnum
import com.tencent.devops.stream.dao.StreamBasicSettingDao
import com.tencent.devops.stream.pojo.GitRequestEvent
import com.tencent.devops.stream.pojo.enums.TriggerReason
Expand Down Expand Up @@ -119,7 +120,7 @@ class GithubPRActionGit(
).accessLevel

// >= TRIAGE
accessLevel >= 20
accessLevel >= GithubAccessLevelEnum.TRIAGE.level
} catch (error: ErrorCodeException) {
false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import com.tencent.devops.common.webhook.pojo.code.git.isMrMergeEvent
import com.tencent.devops.process.yaml.v2.enums.StreamMrEventAction
import com.tencent.devops.process.yaml.v2.enums.StreamObjectKind
import com.tencent.devops.process.yaml.v2.models.on.TriggerOn
import com.tencent.devops.repository.pojo.enums.GitAccessLevelEnum
import com.tencent.devops.scm.pojo.WebhookCommit
import com.tencent.devops.scm.utils.code.git.GitUtils
import com.tencent.devops.stream.dao.StreamBasicSettingDao
Expand Down Expand Up @@ -126,7 +127,7 @@ class TGitMrActionGit(
search = this.data.eventCommon.userId
).find { it.userId == this.data.eventCommon.userId }?.accessLevel

accessLevel != null && accessLevel >= 30
accessLevel != null && accessLevel >= GitAccessLevelEnum.DEVELOPER.level
} catch (error: ErrorCodeException) {
false
}
Expand Down

0 comments on commit 304f57d

Please sign in to comment.