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

403 Forbidden Error when updating labels via REST API #32775

Closed
m4l0n opened this issue Dec 10, 2024 · 5 comments · Fixed by #32776
Closed

403 Forbidden Error when updating labels via REST API #32775

m4l0n opened this issue Dec 10, 2024 · 5 comments · Fixed by #32776
Labels
Milestone

Comments

@m4l0n
Copy link

m4l0n commented Dec 10, 2024

Description

As per title, I'm getting a 403 Forbidden Error when updating labels for issues via REST API. Tried with both the issue id and name. Seems to only happen to my instance (all repositories) running version 1.22.4 in Docker, as I've tested on the demo site (v1.23.0) and cloudron (1.22.4) without any issues.

Gitea Version

1.22.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/m4l0n/eb982cd419bd05cf4924e0e886672774

Screenshots

image

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker installation

Database

PostgreSQL

@yp05327
Copy link
Contributor

yp05327 commented Dec 10, 2024

It seems that your token does not have write permission to this repo's issue or pull request unit.
Can you check it?

@lunny lunny added this to the 1.22.5 milestone Dec 10, 2024
@m4l0n
Copy link
Author

m4l0n commented Dec 10, 2024

Hi @yp05327

My token indeed has write permissions to both issue and repository, which is the same as what I've tried with demo.gitea.com and gitea.com, and cloudron
image

@yp05327
Copy link
Contributor

yp05327 commented Dec 10, 2024

Does the user who created this token has write permission?
If user does not have write permission, even token has write permission, it will only has write permissions which the creator also have.

@m4l0n
Copy link
Author

m4l0n commented Dec 10, 2024

You're right - the user isn't added as a collaborator with write access to the repository. Solved. Thanks!

@yp05327
Copy link
Contributor

yp05327 commented Dec 10, 2024

No need to close this issue, we will fix the internal server error, and it will be closed automatically.
Thanks for your report.

@lunny lunny closed this as completed in 2ac6f2b Dec 10, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Dec 10, 2024
…on (go-gitea#32776)

Fix go-gitea#32775

if permission denined, `prepareForReplaceOrAdd` will return nothing, and
this case is not handled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants