mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 01:30:53 +00:00 
			
		
		
		
	Admin should always be allowed to create repos even if hit limit (#1765)
This commit is contained in:
		
				
					committed by
					
						
						Lunny Xiao
					
				
			
			
				
	
			
			
			
						parent
						
							977dcf96e0
						
					
				
				
					commit
					80cea8747f
				
			@@ -221,6 +221,9 @@ func (u *User) RepoCreationNum() int {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// CanCreateRepo returns if user login can create a repository
 | 
					// CanCreateRepo returns if user login can create a repository
 | 
				
			||||||
func (u *User) CanCreateRepo() bool {
 | 
					func (u *User) CanCreateRepo() bool {
 | 
				
			||||||
 | 
						if u.IsAdmin {
 | 
				
			||||||
 | 
							return true
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if u.MaxRepoCreation <= -1 {
 | 
						if u.MaxRepoCreation <= -1 {
 | 
				
			||||||
		if setting.Repository.MaxCreationLimit <= -1 {
 | 
							if setting.Repository.MaxCreationLimit <= -1 {
 | 
				
			||||||
			return true
 | 
								return true
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user