mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-16 01:43:24 +09:00
fix(repo): centralize repository-scoped authorization (#39063)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user