Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
urz-hgw opened this issue Sep 6, 2024 · 4 comments · Fixed by #32066
Closed

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

urz-hgw opened this issue Sep 6, 2024 · 4 comments · Fixed by #32066
Labels
Milestone

Comments

@urz-hgw
Copy link

urz-hgw commented 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

@yp05327
Copy link
Contributor

yp05327 commented 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. 🤔

@lunny
Copy link
Member

lunny commented Sep 17, 2024

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

@urz-hgw
Copy link
Author

urz-hgw commented 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

@lunny lunny added this to the 1.22.3 milestone Sep 17, 2024
@lunny lunny closed this as completed in 9e0db1b Sep 22, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Sep 22, 2024
The previous implementation requires admin permission to rename branches
which should be write permission.

Fix go-gitea#31993
lunny added a commit that referenced this issue Sep 22, 2024
Backport #32066 by @lunny

The previous implementation requires admin permission to rename branches
which should be write permission.

Fix #31993

Co-authored-by: Lunny Xiao <[email protected]>
@KebabLord
Copy link

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

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants