Add UnitCommitStatus

This commit is contained in:
Norbert Szulc committed 2025-08-30 11:49:03 +00:00
1 parent 35f68afdf6
commit 7c5cc63dc6
3 files changed
+18 -48

No files matched your search

-12
View File
@@ -367,15 +367,3 @@ func (ctx *APIContext) IsUserRepoAdmin() bool {
func (ctx *APIContext) IsUserRepoWriter(unitTypes []unit.Type) bool {
return slices.ContainsFunc(unitTypes, ctx.Repo.CanWrite)
}
// IsUserRepoWriter returns true if current user has write commit status privilege in current repo
func (ctx *APIContext) IsUserCommitStatusWriter(unitTypes []unit.Type) bool {
for _, unitType := range unitTypes {
// TODO
if ctx.Repo.CanWrite(unitType) {
return true
}
}
return false
}