summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-07-17 05:04:43 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-07-17 10:04:43 +0800
commitf33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee (patch)
tree2c6a268356fcb5fd73ee468055869b129b14c6ed /models/repo.go
parent047a67a90b455a077e8b6f6deaad6b7ec4b50810 (diff)
downloadgitea-f33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee.tar.gz
gitea-f33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee.zip
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
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go4
1 files changed, 4 insertions, 0 deletions
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{}{}
}