Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed May 6, 2024
1 parent 6ecdbb6 commit 9e5c420
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/project/project.go
Expand Up @@ -162,10 +162,10 @@ func (p *Project) IsRepositoryProject() bool {
}

func (p *Project) CanBeAccessedByOwnerRepo(ownerID, repoID int64) bool {
if p.Type == TypeOrganization {
return p.OwnerID == ownerID && p.RepoID == 0
if p.Type == TypeRepository {
return p.RepoID == repoID // FIXME: why p.OwnerID==0?
}
return p.OwnerID == ownerID && p.RepoID == repoID
return p.OwnerID == ownerID && p.RepoID == 0
}

func init() {
Expand Down

0 comments on commit 9e5c420

Please sign in to comment.