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

Cannot add attachment to issue without admin access #24944

Closed
hakito opened this issue May 26, 2023 · 5 comments · Fixed by #26837
Closed

Cannot add attachment to issue without admin access #24944

hakito opened this issue May 26, 2023 · 5 comments · Fixed by #26837
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP type/bug

Comments

@hakito
Copy link
Contributor

hakito commented May 26, 2023

Description

I have an issue created by User A.

I try to add an attachment via API for user B. User B is in a Team with write permissions for issues (and everything else)

When I do an sudo upload for user B i get the error:

user should have permission to write issue

But the user has the permission. When I login as user B and do it via the web interface everything works fine.

It only works via API when I give the team admin access.

Gitea Version

1.20.0+dev-919-gf9cfd6ce5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

MySQL

@lunny
Copy link
Member

lunny commented May 30, 2023

Which endpoint are you using?

@lunny
Copy link
Member

lunny commented May 31, 2023

Maybe related #25019

@hakito
Copy link
Contributor Author

hakito commented Jun 5, 2023

The endpoint is: POST /repos/{owner}/{repo}/issues/{index}/assets

@lunny
Copy link
Member

lunny commented Jun 5, 2023

The endpoint is: POST /repos/{owner}/{repo}/issues/{index}/assets

Could you update the the latest version and try it again since #24767 merged.

@hakito
Copy link
Contributor Author

hakito commented Jun 6, 2023

No the error still occurs in Version: 1.20.0+dev-1002-g379ec1303

@lunny lunny added the issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP label Jul 27, 2023
techknowlogick pushed a commit that referenced this issue Sep 1, 2023
… API (#26837)

Fixes #24944

Since a user with write permissions for issues can add attachments to an
issue via the the web interface, the user should also be able to add
attachments via the API
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants