Fix new team (#18212)

fix regression from #17811
This commit is contained in:
Lunny Xiao 2022-01-08 23:19:36 +08:00 committed by GitHub
parent 70d7475356
commit 23f5a34c89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -193,6 +193,14 @@ func (u Unit) IsLessThan(unit Unit) bool {
return u.Idx < unit.Idx
}
// MaxPerm returns the max perms of this unit
func (u Unit) MaxPerm() perm.AccessMode {
if u.Type == TypeExternalTracker || u.Type == TypeExternalWiki {
return perm.AccessModeRead
}
return perm.AccessModeAdmin
}
// Enumerate all the units
var (
UnitCode = Unit{