diff options
author | Unknwon <u@gogs.io> | 2015-12-10 12:37:53 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-10 12:37:53 -0500 |
commit | 2a0bb1fa906a4d135ed88de4f705c3ab7214e60c (patch) | |
tree | 37d207458c999c5789fd6ca3a2c62d6700ed81b7 /models/repo.go | |
parent | c6083c335e53a860fd4c500a86dcdda49a16515e (diff) | |
download | gitea-2a0bb1fa906a4d135ed88de4f705c3ab7214e60c.tar.gz gitea-2a0bb1fa906a4d135ed88de4f705c3ab7214e60c.zip |
#1575 Limit repo creation
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go index 307f86cb25..fafc3b9c90 100644 --- a/models/repo.go +++ b/models/repo.go @@ -900,6 +900,10 @@ func createRepository(e *xorm.Session, u *User, repo *Repository) (err error) { // CreateRepository creates a repository for given user or organization. func CreateRepository(u *User, opts CreateRepoOptions) (_ *Repository, err error) { + if !u.CanCreateRepo() { + return nil, ErrReachLimitOfRepo{u.MaxRepoCreation} + } + repo := &Repository{ OwnerID: u.Id, Owner: u, |