You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models
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).
2 weeks ago
..
actions Refactor RefName (#33234) 3 weeks ago
activities Refactor RefName (#33234) 3 weeks ago
admin Fix javascript error when an anonymous user visiting migration page (#32144) 4 months ago
asymkey Refactor older tests to use testify (#33140) 3 weeks ago
auth Refactor tests (#33021) 1 month ago
avatars Replace 10 more gt- classes with tw- (#29945) 10 months ago
db Refactor older tests to use testify (#33140) 3 weeks ago
dbfs Enable `unparam` linter (#31277) 8 months ago
fixtures Only allow admins to rename default/protected branches (#33276) 2 weeks ago
git Enable tenv and testifylint rules (#32852) 2 months ago
issues Fix unpin hint on the pinned pull requests (#33207) 3 weeks ago
migrations Automerge supports deleting branch automatically after merging (#32343) 3 weeks ago
organization Refactor older tests to use testify (#33140) 3 weeks ago
packages Refactor maven package registry (#33049) 1 month ago
perm Support public code/issue access for private repositories (#33127) 2 weeks ago
project Use project's redirect url instead of composing url (#33058) 1 month ago
pull Automerge supports deleting branch automatically after merging (#32343) 3 weeks ago
renderhelper Refactor render system (orgmode) (#32671) 2 months ago
repo Fix missing license when sync mirror (#33255) 2 weeks ago
secret Clarify Actions resources ownership (#31724) 6 months ago
shared/types Refactor locale&string&template related code (#29165) 12 months ago
system Refactor deletion (#28610) 1 year ago
unit Add `DEFAULT_MIRROR_REPO_UNITS` and `DEFAULT_TEMPLATE_REPO_UNITS` options (#32416) 3 months ago
unittest Refactor ref type (#33242) 2 weeks ago
user Some small refactors (#33144) 3 weeks ago
webhook Let API create and edit system webhooks, attempt 2 (#33180) 3 weeks ago
main_test.go make writing main test easier (#27270) 1 year ago
repo.go Fix issue comment number (#30556) 1 month ago
repo_test.go Fix issue comment number (#30556) 1 month ago