mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 14:03:24 +09:00
fix(repo): centralize repository-scoped authorization (#39063)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -39,6 +39,18 @@ func (t TeamList) AnyRepoUnitMaxAccess(ctx context.Context, tp unit.Type) perm.A
|
||||
return maxAccess
|
||||
}
|
||||
|
||||
func (t TeamList) HasAllRepoAdminAccess() bool {
|
||||
for _, team := range t {
|
||||
if team.IsOwnerTeam() || team.AccessMode == perm.AccessModeOwner {
|
||||
return true
|
||||
}
|
||||
if team.IncludesAllRepositories && team.AccessMode >= perm.AccessModeAdmin {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// SearchTeamOptions holds the search options
|
||||
type SearchTeamOptions struct {
|
||||
db.ListOptions
|
||||
|
||||
Reference in New Issue
Block a user