Team permissions on private repos are not merged correctly #14799

Open
opened 2025-11-02 11:23:17 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @KimonHoffmann on GitHub (Jul 24, 2025).

Description

In releases prior to 1.24.0 any user who is a member of multiple teams with permissions on private repositories received the maximum permissions from all teams.

Since upgrading to 1.24.3 these users are limited by the limited permissions instead.

Example:

  • Team X: Write Access to PRs on all repos of an org
  • Team Y: No Access to PRs on all repos of an org
  • User A: Member of both X and Y

Effects:

  • User A can not see or access PRs (404).
  • User A is available as a reviewer on PRs in the dropdown list.
  • Attempts to assign user A as a reviewer results in no action being taken with the following message in the log:
.../web/repo/pull_review.go:434:UpdatePullReviewRequest() [W] UpdatePullReviewRequest: refusing to add invalid review request for <User USER_ID:USER_NAME> to <Repository REPO_ID:ORG/REPO>#18: Error: Reviewer can't read [...]

The most similar issue I found is #33456, which is supposed to be fixed in 1.24.3, but still might be related.

Gitea Version

1.24.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.49.1

Operating System

Linux (amd64)

How are you running Gitea?

Prebuilt official OCI image

Database

SQLite

Originally created by @KimonHoffmann on GitHub (Jul 24, 2025). ### Description In releases prior to 1.24.0 any user who is a member of multiple teams with permissions on private repositories received the maximum permissions from all teams. Since upgrading to 1.24.3 these users are limited by the limited permissions instead. Example: * Team X: Write Access to PRs on all repos of an org * Team Y: No Access to PRs on all repos of an org * User A: Member of both X and Y Effects: * User A can not see or access PRs (404). * User A **is** available as a reviewer on PRs in the dropdown list. * Attempts to assign user A as a reviewer results in no action being taken with the following message in the log: ``` .../web/repo/pull_review.go:434:UpdatePullReviewRequest() [W] UpdatePullReviewRequest: refusing to add invalid review request for <User USER_ID:USER_NAME> to <Repository REPO_ID:ORG/REPO>#18: Error: Reviewer can't read [...] ``` The most similar issue I found is #33456, which is supposed to be fixed in 1.24.3, but still might be related. ### Gitea Version 1.24.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.49.1 ### Operating System Linux (amd64) ### How are you running Gitea? Prebuilt official OCI image ### Database SQLite
GiteaMirror added the type/bugissue/workaround labels 2025-11-02 11:23:17 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jul 25, 2025):

Team X: Write Access to PRs on all repos of an org

Can you try to edit Team X and save again (even without change)?

@wxiaoguang commented on GitHub (Jul 25, 2025): > Team X: Write Access to PRs on all repos of an org Can you try to edit Team X and save again (even without change)?
Author
Owner

@wxiaoguang commented on GitHub (Jul 25, 2025):

Unable to reproduce:

Image Image Image
@wxiaoguang commented on GitHub (Jul 25, 2025): Unable to reproduce: <img width="1990" height="1528" alt="Image" src="https://github.com/user-attachments/assets/ec74c406-1ba3-4b79-915e-a3c4c99285ef" /> <img width="1876" height="1560" alt="Image" src="https://github.com/user-attachments/assets/f15131a1-d1fc-42d4-8762-f1c44b9bda39" /> <img width="1594" height="1194" alt="Image" src="https://github.com/user-attachments/assets/9d53169a-935f-4a13-9dba-4700b082927e" />
Author
Owner

@KimonHoffmann commented on GitHub (Jul 25, 2025):

I just tried the following:

  1. Add a new user to both teams
  2. Verify the reported behavior
  3. Editied Team Y (not X), without making any changes
  4. Try to re-verify the reported behavior, without success

So Step 3 resolved the issue. Sorry for editing Team Y instead of X, I got the roles mixed up when following the instructions.

@KimonHoffmann commented on GitHub (Jul 25, 2025): I just tried the following: 1. Add a new user to both teams 2. Verify the reported behavior 3. Editied Team **Y** (not X), without making any changes 4. Try to re-verify the reported behavior, without success So Step 3 resolved the issue. Sorry for editing Team Y instead of X, I got the roles mixed up when following the instructions.
Author
Owner

@wxiaoguang commented on GitHub (Jul 25, 2025):

In old Gitea, the team permission were messed up, some members got unrelated permissions, 1.24 corrected the behavior, but some "teams" need to be updated.

So I think the issue could be marked as "resolved"?

@wxiaoguang commented on GitHub (Jul 25, 2025): In old Gitea, the team permission were messed up, some members got unrelated permissions, 1.24 corrected the behavior, but some "teams" need to be updated. So I think the issue could be marked as "resolved"?
Author
Owner

@KimonHoffmann commented on GitHub (Jul 25, 2025):

Yes, in this specific case it has been resolved, and I know what I need to do next time I encounter it.

But since it's not clear which teams are affected is there maybe a possibility to add something to doctor or the DB migration step to fix these messed up team permissions proactively?

@KimonHoffmann commented on GitHub (Jul 25, 2025): Yes, in this specific case it has been resolved, and I know what I need to do next time I encounter it. But since it's not clear which teams are affected is there maybe a possibility to add something to `doctor` or the DB migration step to fix these messed up team permissions proactively?
Author
Owner

@GiteaBot commented on GitHub (Aug 24, 2025):

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@GiteaBot commented on GitHub (Aug 24, 2025): We close issues that need feedback from the author if there were no new comments for a month. :tea:
Author
Owner

@KimonHoffmann commented on GitHub (Aug 24, 2025):

As far as I can tell there is no feedback outstanding, and the tag is left over by error.

@KimonHoffmann commented on GitHub (Aug 24, 2025): As far as I can tell there is no feedback outstanding, and the tag is left over by error.
Author
Owner

@wxiaoguang commented on GitHub (Aug 24, 2025):

Reopened.

(But maybe this one will be just like other 2000+ pending&inactive issues if nobody would touch it 😅 )

@wxiaoguang commented on GitHub (Aug 24, 2025): Reopened. (But maybe this one will be just like other 2000+ pending&inactive issues if nobody would touch it 😅 )
Author
Owner

@lynxplay commented on GitHub (Sep 16, 2025):

I ran into something similar for collaborators on private repos, https://github.com/go-gitea/gitea/pull/35501 fixed that for me, so potentially related?

@lynxplay commented on GitHub (Sep 16, 2025): I ran into something *similar* for collaborators on private repos, https://github.com/go-gitea/gitea/pull/35501 fixed that for me, so potentially related?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14799