mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	Check permission for the appropriate unit type (#14261)
* Check permission for the appropriate unit type Fixes false positives for "User created Issues in Repository which they no longer have access to" errors * change log level to Debug Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		@@ -551,8 +551,8 @@ func Issues(ctx *context.Context) {
 | 
				
			|||||||
				ctx.ServerError("GetUserRepoPermission", fmt.Errorf("[%d]%v", repoID, err))
 | 
									ctx.ServerError("GetUserRepoPermission", fmt.Errorf("[%d]%v", repoID, err))
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if !perm.CanRead(models.UnitTypeIssues) {
 | 
								if !perm.CanRead(unitType) {
 | 
				
			||||||
				log.Error("User created Issues in Repository which they no longer have access to: [%d]", repoID)
 | 
									log.Debug("User created Issues in Repository which they no longer have access to: [%d]", repoID)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user