Remove unit types commits and settings (#2161)
* Remove unit types commits and settings * Can not limit units in administrator teams * Limit changing units only to teams with read and write access mode * Small code optimization
This commit is contained in:
@ -377,6 +377,10 @@ func (repo *Repository) getUnitsByUserID(e Engine, userID int64, isAdmin bool) (
|
||||
|
||||
var allTypes = make(map[UnitType]struct{}, len(allRepUnitTypes))
|
||||
for _, team := range teams {
|
||||
// Administrators can not be limited
|
||||
if team.Authorize >= AccessModeAdmin {
|
||||
return nil
|
||||
}
|
||||
for _, unitType := range team.UnitTypes {
|
||||
allTypes[unitType] = struct{}{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user