0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-02-21 00:34:26 +01:00
gitea/routers/web/repo
Kemal Zebari 2483a93fbc
Only allow admins to rename default/protected branches (#33276)
Currently, anyone with write permissions to a repo are able to rename
default or protected branches.

This change follows
[GitHub's](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch)
design by only allowing repo/site admins to change these branches.
However, it also follows are current design for protected branches and
only allows admins to modify branch names == branch protection rule
names. Glob-based rules cannot be renamed by anyone (as was already the
case, but we now catch `ErrBranchIsProtected` which we previously did
not catch, throwing a 500).
2025-01-15 20:51:49 +00:00
..
actions
setting Only allow admins to rename default/protected branches (#33276) 2025-01-15 20:51:49 +00:00
activity.go
attachment.go
blame.go
branch.go
cherry_pick.go
code_frequency.go
commit.go Simplify context ref name (#33267) 2025-01-15 11:15:47 +08:00
compare.go
contributors.go
download.go
editor_test.go
editor.go
find.go
fork.go
githttp_test.go
githttp.go
helper.go
issue_comment.go
issue_content_history.go
issue_dependency.go
issue_label_test.go
issue_label.go
issue_list.go
issue_lock.go
issue_new.go
issue_page_meta.go
issue_pin.go
issue_poster.go
issue_stopwatch.go
issue_suggestions.go
issue_test.go
issue_timetrack.go
issue_view.go
issue_watch.go
issue.go
main_test.go
middlewares.go
migrate.go
milestone.go
packages.go
patch.go
projects_test.go
projects.go
pull_review_test.go
pull_review.go
pull.go
recent_commits.go
release_test.go
release.go
render.go
repo.go
search_test.go
search.go
topic.go
treelist.go
view_file.go
view_home.go
view_readme.go
view_test.go
view.go
wiki_test.go
wiki.go