Hi, I am trying to setup a Gitea instance with the following user account/organization/repository/team permissions:
Organizations:
mycorp
anothercorp
Users:
User0 (admin)
Bob
Alice
Eve
Repositories:
mycorp/projecta
anothercorp/projectb
anothercorp/projectc
Permissions:
Bob: can read/write everything on mycorp/projecta, but cannot access/view anothercorp’s repositories
Alice: can read/write everything on anothercorp/projectb, cannot view mycorp’s repositories
Eve: can only access antohercorp/projectc issues, cannot see the code/pulls, cannot list or access anything else.
I’m a bit lost regarding granular permissions, I only found how to add a user as Collaborator on a project (in which case global access is either read/write/admin on every feature in a repository), or how to add a Reporter team in anothercorp with limited access to issues, and add that user to it, but this user still has to be added to Collaborators on the repository else they can’t access it at all (then back to problem 1, has read/write access on the whole repo).
Can someone explain me how I should proceed to create users with these permission levels?
create a new team on antohercorp which with read permission and only issues unit. The team only could access projectc and add Eve to this team.
No Collaborator config.
create a new team on antohercorp which with read permission and only issues unit. The team only could access projectc and add Eve to this team.
With this scenario, Eve CAN see repo code
Thanks, I found the answer to my question. Here is a similar setup, and it works:
Create 3 users:
bob
alice
eve
Create 2 organizations (only 1 will be used in this example):
mycorp
anothercorp
Create 3 private repositories for the organizationanothercorp:
anothercorp-x
anothercorp-y
anothercorp-z
In anothercorp, create 3 teams:
developers_all_projects:
Description: Developers for all anothercorp projects
Permissions: Write access to everything
developers_projectx:
Description: Developers for anothercorp-x
Permissions: Write access to everything
reporters_projectx:
Description: Bug reporters for anothercorp-x
Permissions: Write access to issues only
Add users to each team:
developers_all_projects: bob
developers_projectx: alice
reporters_projectx: eve
Add repositories to each team! This is what I was missing. Eve was able to read everything on a project because it was a public project (my mistake).
developers_all_projects: anothercorp-x, y and z
developers_projectx: anothercorp-x
reporters_projectx: anothercorp-x
It works! Each user can only see/list repositories assigned to their team, with the permissions from their team. Only organization owners can list everything.
Teams are defined at organization level, but their permission levels only apply to repositories they’ve been given access to. All areas of a public repository are always readable by everyone (even outside the org?).