mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 11:35:03 +01:00 
			
		
		
		
	Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
* site admin could create repos even MAX_CREATION_LIMIT=0 * Optimize if structure
This commit is contained in:
		
							parent
							
								
									0e464995ce
								
							
						
					
					
						commit
						578cf52ce5
					
				| @ -1411,7 +1411,7 @@ func createRepository(e *xorm.Session, doer, u *User, repo *Repository) (err err | |||||||
| 
 | 
 | ||||||
| // 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} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user