* site admin could create repos even MAX_CREATION_LIMIT=0 * Optimize if structuretags/v1.6.0-dev
// CreateRepository creates a repository for the user/organization u. | // CreateRepository creates a repository for the user/organization u. | ||||
func CreateRepository(doer, u *User, opts CreateRepoOptions) (_ *Repository, err error) { | func CreateRepository(doer, u *User, opts CreateRepoOptions) (_ *Repository, err error) { | ||||
if !u.CanCreateRepo() { | |||||
if !doer.IsAdmin && !u.CanCreateRepo() { | |||||
return nil, ErrReachLimitOfRepo{u.MaxRepoCreation} | return nil, ErrReachLimitOfRepo{u.MaxRepoCreation} | ||||
} | } | ||||