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

Org admin users can not access org project #25670

Open
yp05327 opened this issue Jul 4, 2023 · 3 comments
Open

Org admin users can not access org project #25670

yp05327 opened this issue Jul 4, 2023 · 3 comments
Assignees
Labels

Comments

@yp05327
Copy link
Contributor

yp05327 commented Jul 4, 2023

Description

Thanks @kerwin612 for reporting this issue.

In some special cases, org admin users can not access org level project unit.
I also noticed this issue several month ago, but I can't reproduce this issue again, so I didn't report this bug.

But @kerwin612 also reported this issue today, so it seems that this is a reproducible issue.

This issue can be fixed by some magic operations:

  • convert the permission into General Access, you will see the permission of project unit is No Access.
  • convert it into Write, and save.
  • convert the permission into Administrator Access, and save.
  • Now the team will become a real admin team :)
  • Then no matter what permission you set in General Access, Administrator Access would work well.

ps: I also can't reproduce this issue now in a new 1.19.3 Gitea instance or an old 1.18.5 instance update to 1.19.3

Edit:
I misunderstand this issue, admin users can not access org level project unit, not repo level project unit.
I can reproduce this issue now, let's fix it. 😄

Gitea Version

1.19.3

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?

self host

Database

None

@yp05327 yp05327 changed the title Sometimes org admin teams can not access repo project unit Sometimes org admin teams can not access org project unit Jul 4, 2023
@yp05327 yp05327 changed the title Sometimes org admin teams can not access org project unit Org admin users can not access org project Jul 4, 2023
@yp05327
Copy link
Contributor Author

yp05327 commented Jul 4, 2023

I know what happened...

There are two problems:

So we need a migration to add unit permission record in for admin teams in team_unit table.
But we have no way to make a migration backport, so this issue can not be fixed in old versions, or we need to rewrite the logic of UnitMaxAccess in old versions. Which is better?

@lunny
Copy link
Member

lunny commented Jul 4, 2023

If team.IsAdminTeam() {
return perm.AccessModeAdmin
}

@kerwin612
Copy link
Member

I know what happened...

There are two problems:

So we need a migration to add unit permission record in for admin teams in team_unit table. But we have no way to make a migration backport, so this issue can not be fixed in old versions, or we need to rewrite the logic of UnitMaxAccess in old versions. Which is better?

063B511F

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