fix: branch protection user list (#38570)

fix #38569, also fix the UI
This commit is contained in:
wxiaoguang
2026-07-23 02:48:39 +08:00
committed by GitHub
parent 4563c2c1b7
commit ae2ff1b467
11 changed files with 23 additions and 21 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ func SettingsProtectedBranch(c *context.Context) {
c.Data["PageIsSettingsBranches"] = true
c.Data["Title"] = c.Locale.TrString("repo.settings.protected_branch") + " - " + rule.RuleName
users, err := access_model.GetUsersWithUnitAccess(c, c.Repo.Repository, perm.AccessModeRead, unit.TypePullRequests)
users, err := access_model.GetUsersWithAnyUnitAccess(c, c.Repo.Repository, perm.AccessModeRead, unit.TypeCode, unit.TypePullRequests)
if err != nil {
c.ServerError("GetUsersWithUnitAccess", err)
return
+1 -1
View File
@@ -149,7 +149,7 @@ func setTagsContext(ctx *context.Context) error {
}
ctx.Data["ProtectedTags"] = protectedTags
users, err := access_model.GetUsersWithUnitAccess(ctx, ctx.Repo.Repository, perm.AccessModeRead, unit.TypePullRequests)
users, err := access_model.GetUsersWithAnyUnitAccess(ctx, ctx.Repo.Repository, perm.AccessModeRead, unit.TypeCode, unit.TypePullRequests)
if err != nil {
ctx.ServerError("GetUsersWithUnitAccess", err)
return err