summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2017-02-14 20:16:00 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2017-02-14 20:16:00 +0800
commitd67b278a0d05e122bf510ac52bfbd69eab4f654d (patch)
tree28fe4dd05973026013666fd0320a7dea40d94109 /models/user.go
parent23aba523b551d20ee2bbc694ae630989bcdeaccd (diff)
downloadgitea-d67b278a0d05e122bf510ac52bfbd69eab4f654d.tar.gz
gitea-d67b278a0d05e122bf510ac52bfbd69eab4f654d.zip
feat: Able to disable non-admin to create new organization (#927)
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go
index 0e1710de7e..5f0816cd48 100644
--- a/models/user.go
+++ b/models/user.go
@@ -223,7 +223,7 @@ func (u *User) CanCreateRepo() bool {
// CanCreateOrganization returns true if user can create organisation.
func (u *User) CanCreateOrganization() bool {
- return u.IsAdmin || u.AllowCreateOrganization
+ return u.IsAdmin || (u.AllowCreateOrganization && !setting.Admin.DisableRegularOrgCreation)
}
// CanEditGitHook returns true if user can edit Git hooks.