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

Unable to git-push to existing repos (probably related to the unit feature) #1947

Closed
2 of 7 tasks
typeless opened this issue Jun 12, 2017 · 5 comments · Fixed by #1968
Closed
2 of 7 tasks

Unable to git-push to existing repos (probably related to the unit feature) #1947

typeless opened this issue Jun 12, 2017 · 5 comments · Fixed by #1968
Assignees
Labels
Milestone

Comments

@typeless
Copy link
Contributor

typeless commented Jun 12, 2017

  • Gitea version (or commit ref):
    Gitea Version: 1.1.0+292-g113b3e9

  • Git version:
    2.7.4

  • Operating system:
    Ubuntu 16.04 64bit

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Got rejected and an error message User Scott does not have allowed access to repository my/test-repo's code while doing git push. It worked before.

A quick search gives me the clue but I don't quite understand what it's about.

if !repo.CheckUnitUser(authUser.ID, authUser.IsAdmin, unitType) {
    ctx.HandleText(http.StatusForbidden, fmt.Sprintf("User %s does not have allowed access to repository %s 's code",
    authUser.Name, repo.RepoPath()))
    return
}
```
...
@lunny
Copy link
Member

lunny commented Jun 12, 2017

It means the user have no right to push to this project.

@typeless
Copy link
Contributor Author

@lunny I see. But the write permission has been enabled for the user in the 'Collaboration' settings and it worked before the recent update. What other settings should I check first or probably can diagnose?

@lunny
Copy link
Member

lunny commented Jun 13, 2017

I will test it.

@lunny lunny added the type/bug label Jun 13, 2017
@lunny lunny added this to the 1.2.0 milestone Jun 13, 2017
@typeless
Copy link
Contributor Author

typeless commented Jun 13, 2017

So far I found that the problem is due to some users in the organization don't belong to any team.

See https://github.com/go-gitea/gitea/blob/master/models/repo.go#L366. When the user does not belong to any team, the slice teams will be empty. And then the following slice construction code will get nothing to built upon as well.

For now I can workaround this problem by creating a team for all non-owner members.

@lunny
Copy link
Member

lunny commented Jun 13, 2017

So a Collaboration of one repo on an organization should be given read/write rights for all units? I think yes. I will send a PR to fix this.

@lunny lunny self-assigned this Jun 14, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants