mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	#1575 Limit repo creation
This commit is contained in:
		@@ -107,6 +107,19 @@ func (err ErrUserHasOrgs) Error() string {
 | 
			
		||||
	return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type ErrReachLimitOfRepo struct {
 | 
			
		||||
	Limit int
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IsErrReachLimitOfRepo(err error) bool {
 | 
			
		||||
	_, ok := err.(ErrReachLimitOfRepo)
 | 
			
		||||
	return ok
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (err ErrReachLimitOfRepo) Error() string {
 | 
			
		||||
	return fmt.Sprintf("user has reached maximum limit of repositories [limit: %d]", err.Limit)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//  __      __.__ __   .__
 | 
			
		||||
// /  \    /  \__|  | _|__|
 | 
			
		||||
// \   \/\/   /  |  |/ /  |
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user