5

I am new to Gogs. Have a trouble related to creating organizations (groups).

I created an organization Org-A and added a private repository Repo-A to it. I added another user User-A to this organization (as a member and a team member). But when User-A wants to see content of Repo-A, Gogs shows a "404: Not Found" page. When I change the privacy of Repo-A to public User-A can see it, but all other users also can see it.

How can I group repositories into organizations and add different users to these organizations, that users can read/write repositories in the organization they are member of? I want repos to be visible/editable only for organization members.

0bj3ct
  • 1,400
  • 4
  • 22
  • 51

2 Answers2

3

As mentioned in issue 1744:

Adding those users to team under organization solves to issue.

Somehow we expected to default behavior of joining an Organization should give those users to read permission.

If this is still not working (ie, the User was already in a Team of the right organization):

  • double-check the case of the url (it is case sensitive)
  • try and check if you reproduce the same problem with gitea (a fork of gogs)

As commented by Hamish Carpenter:

I finally found the screen to add link teams with repositories.
This then allows you to add repositories to other teams eg Developers.

When you see the team on the right hand side, click on the "0 Repositories" link then add the repositories like you'd add team members.

Igor Dejanović adds:

You set the permission on the team.
Then on the team page follow the links "x members" to add new member and "y repositories" to add new repository.
Team is essentially a many-to-many link between members and repositories.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • The only way is to add users to the "Owners" team. And as a result they will have full permissions on all repositories. It means that I cannot restrict access of users depending on team (read, write, admin). This is confusing a bit. Thanks for your help! – 0bj3ct Jan 18 '17 at 10:43
  • I struggled with this today using Gitea. I finally found the screen to add link teams with repositories. This then allows you to add repositories to other teams eg Developers. When you see the team on the right hand side, click on the "0 Repositories" link then add the repositories like you'd add team members. – Hamish Carpenter Mar 01 '18 at 04:31
  • @HamishCarpenter Thanks a lot for your comment. It is indeed a solution. You set the permission on the team. Then on the team page follow the links "x members" to add new member and "y repositories" to add new repository. Team is essentially a many-to-many link between members and repositories. – Igor Dejanović Sep 24 '18 at 16:39
  • @IgorDejanović Good point. I have include Hamish's and your comment in the answer for more visibility. – VonC Sep 24 '18 at 16:55
3

Maybe the previous answer by Vonc was correct for older versions of gogs, but in my version (0.11.43) it is not correct.

You can read what the gogs maintainer (Unknown) wrote about it here:

By design, only the Owners team get access when create a new repository, if need to add this repository to other teams manually. gogs issue #1834

And also, the discussion on how to make team repos. (One look at the image inside this link and you'll understand how to add repos to teams in an organization).

To make this clear, I will add some info here:

For me the confusion come from the fact that I used to add members as collaborators into repos, but in the organizations-teams, you need to add the repos into the teams.

In a Gogs organization you can create repositories and teams. By default each organization comes with one team named: Owners. the team members of Owners can read/write all the repos in the organization.

For each new team you create, the team starts with no repositories associated with it, so the team members cannot access any private repositories (for public repos there is no issue anyone can see them).

You can add any of the organization repos to each team, and in the teams settings page, set the permissions (read/write)

Returning to the specific question:

Org-A -> team-A(write/read permission only) - > member-A

Org-A:Repo-A(private)

if you want any member of team-A to access Repo-A, Add Repo-A into team-A repositories.

Have to finish with something that still not is feeling right in the organization permission process:

  • it is possible to manually add any user to any repo as a collaborator and set its permission directly from the repo settings
  • but, it is not possible to add in the same screen a team as a collaborator, (this should be done from the team page).
  • and more then that, if you enter into the repo settings - collaboration page, you will not see the teams that can access this repo, you will see only manually set users.
Kings85
  • 345
  • 2
  • 15