forked from forgejo/forgejo
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:
parent
047a67a90b
commit
f33e6ae09e
20 changed files with 174 additions and 104 deletions
|
@ -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{}{}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue