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 68c3fdc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/project/project.go
Original file line number Diff line number Diff line change
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 // if a project belongs to a repository, then its OwnerID is 0 and can be ignored
}
return p.OwnerID == ownerID && p.RepoID == repoID
return p.OwnerID == ownerID && p.RepoID == 0
}

func init() {
Expand Down

0 comments on commit 68c3fdc

Please sign in to comment.