mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-18 15:02:43 +00:00
#1575 Limit repo creation
This commit is contained in:
1 parent
c6083c335e
commit
2a0bb1fa90
15 files changed
+73
-14
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user