Team members can't rename branch but adding and deletion is possible #13462

Closed
opened 2025-11-02 10:43:01 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @urz-hgw on GitHub (Sep 6, 2024).

Description

Hi,

it looks like there is a permission issue so that team members can't rename branches.

I can reproduce it like this:

There is an organization O with a Team T.

The Team T has access to specific repositories with General access and at Allow Access to Repository Sections every section is set to write.
Then I add user X to the Team T .. X is NOT an owner of the organization.

Then I create a repository REPO inside the organization O and add the team T to it.
The user X now has the permission to add and delete a branch in REPO, but renaming a branch leads to a 404 error message.

The log output is

gitea-1    | 2024/09/06 09:25:21 ...eb/routing/logger.go:102:func1() [I] router: completed POST /O/REPO/settings/rename_branch for 192.168.82.13:52774, 404 Not Found in 20.2ms @ context/permission.go:17(web.registerRoutes.RequireRepoAdmin)

Best regards
Daniel

Gitea Version

1.22.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Debian 12

How are you running Gitea?

Via docker

Database

MySQL/MariaDB

Originally created by @urz-hgw on GitHub (Sep 6, 2024). ### Description Hi, it looks like there is a permission issue so that team members can't rename branches. I can reproduce it like this: There is an organization **O** with a Team **T**. The Team **T** has access to `specific repositories` with `General access` and at `Allow Access to Repository Sections` every section is set to **write**. Then I add user **X** to the Team **T** .. **X** is NOT an owner of the organization. Then I create a repository **REPO** inside the organization **O** and add the team **T** to it. The user **X** now has the permission to add and delete a branch in **REPO**, but renaming a branch leads to a 404 error message. The log output is ``` gitea-1 | 2024/09/06 09:25:21 ...eb/routing/logger.go:102:func1() [I] router: completed POST /O/REPO/settings/rename_branch for 192.168.82.13:52774, 404 Not Found in 20.2ms @ context/permission.go:17(web.registerRoutes.RequireRepoAdmin) ``` Best regards Daniel ### Gitea Version 1.22.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Debian 12 ### How are you running Gitea? Via docker ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 10:43:01 -06:00
Author
Owner

@yp05327 commented on GitHub (Sep 17, 2024):

I'm not sure whether it is by design.
But it makes sense if user has write permission, they should can rename the branch. 🤔

@yp05327 commented on GitHub (Sep 17, 2024): I'm not sure whether it is by design. But it makes sense if user has write permission, they should can rename the branch. 🤔
Author
Owner

@lunny commented on GitHub (Sep 17, 2024):

If user can delete branch, it should have permission to create a new one.

@lunny commented on GitHub (Sep 17, 2024): If user can delete branch, it should have permission to create a new one.
Author
Owner

@urz-hgw commented on GitHub (Sep 17, 2024):

If user can delete branch, it should have permission to create a new one.

Just to clarify: adding and deleting a branch works, it is renaming a branch, that causes an error message

@urz-hgw commented on GitHub (Sep 17, 2024): > If user can delete branch, it should have permission to create a new one. Just to clarify: adding and deleting a branch works, it is renaming a branch, that causes an error message
Author
Owner

@KebabLord commented on GitHub (Sep 25, 2024):

I can verify the problem at Version: 1.22.1
deletion or creation is possible but /user/repo/settings/rename_branch returns 404

i'm glad that it will be fixed with new release

@KebabLord commented on GitHub (Sep 25, 2024): I can verify the problem at Version: 1.22.1 deletion or creation is possible but /user/repo/settings/rename_branch returns 404 i'm glad that it will be fixed with new release
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13462