diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-02-14 20:16:00 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-14 20:16:00 +0800 |
commit | d67b278a0d05e122bf510ac52bfbd69eab4f654d (patch) | |
tree | 28fe4dd05973026013666fd0320a7dea40d94109 /models/user.go | |
parent | 23aba523b551d20ee2bbc694ae630989bcdeaccd (diff) | |
download | gitea-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.go | 2 |
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. |