mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	fix permission check on api create org (#5523)
This commit is contained in:
		
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							ba75319157
						
					
				
				
					commit
					58c4559d3b
				
			@@ -85,7 +85,7 @@ func Create(ctx *context.APIContext, form api.CreateOrgOption) {
 | 
				
			|||||||
	//   "422":
 | 
						//   "422":
 | 
				
			||||||
	//     "$ref": "#/responses/validationError"
 | 
						//     "$ref": "#/responses/validationError"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if !ctx.User.AllowCreateOrganization {
 | 
						if !ctx.User.CanCreateOrganization() {
 | 
				
			||||||
		ctx.Error(403, "Create organization not allowed", nil)
 | 
							ctx.Error(403, "Create organization not allowed", nil)
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user