Skip to content

Commit 68c3fdc

Browse files
committed
fix
1 parent 6ecdbb6 commit 68c3fdc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

models/project/project.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ func (p *Project) IsRepositoryProject() bool {
162162
}
163163

164164
func (p *Project) CanBeAccessedByOwnerRepo(ownerID, repoID int64) bool {
165-
if p.Type == TypeOrganization {
166-
return p.OwnerID == ownerID && p.RepoID == 0
165+
if p.Type == TypeRepository {
166+
return p.RepoID == repoID // if a project belongs to a repository, then its OwnerID is 0 and can be ignored
167167
}
168-
return p.OwnerID == ownerID && p.RepoID == repoID
168+
return p.OwnerID == ownerID && p.RepoID == 0
169169
}
170170

171171
func init() {

0 commit comments

Comments
 (0)