From f33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Mon, 17 Jul 2017 05:04:43 +0300 Subject: 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 --- models/repo.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'models/repo.go') diff --git a/models/repo.go b/models/repo.go index cb6d6d5c3c..a651aae89b 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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{}{} } -- cgit v1.2.3