0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-02-21 00:34:26 +01:00
gitea/routers/api/v1/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
..
action.go
avatar.go
blob.go
branch.go Only allow admins to rename default/protected branches (#33276) 2025-01-15 20:51:49 +00:00
collaborators.go
commits.go
compare.go
download.go
file.go
fork.go
git_hook.go
git_ref.go
hook_test.go Clarify path param naming (#32969) 2024-12-24 13:47:45 +00:00
hook.go
issue_attachment.go
issue_comment_attachment.go
issue_comment.go
issue_dependency.go
issue_label.go
issue_pin.go
issue_reaction.go
issue_stopwatch.go
issue_subscription.go
issue_tracked_time.go
issue.go
key.go
label.go
language.go
license.go
main_test.go
migrate.go
milestone.go
mirror.go
notes.go
patch.go
pull_review.go
pull.go
release_attachment.go
release_tags.go
release.go
repo_test.go
repo.go
star.go
status.go
subscriber.go
tag.go
teams.go
topic.go
transfer.go
tree.go
wiki.go