fix(repo): centralize repository-scoped authorization (#39063)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
bircni
2026-08-26 20:12:53 +08:00
committed by GitHub
co-authored by wxiaoguang
parent 90c43e8e78
commit e21c37703e
27 changed files with 383 additions and 476 deletions
+1 -5
View File
@@ -74,11 +74,7 @@ func roleDescriptor(ctx *context.Context, repo *repo_model.Repository, poster *u
return roleDesc, nil
}
// Otherwise (poster is site admin), check if poster is the real repo admin.
isRealRepoAdmin, err := access_model.IsUserRealRepoAdmin(ctx, repo, poster)
if err != nil {
return roleDesc, err
}
if isRealRepoAdmin {
if access_model.IsUserRealRepoAdmin(ctx, repo, poster) {
roleDesc.RoleInRepo = issues_model.RoleRepoOwner
return roleDesc, nil
}