parent
70d7475356
commit
23f5a34c89
2 changed files with 11 additions and 3 deletions
|
@ -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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue