We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ecdbb6 commit 68c3fdcCopy full SHA for 68c3fdc
models/project/project.go
@@ -162,10 +162,10 @@ func (p *Project) IsRepositoryProject() bool {
162
}
163
164
func (p *Project) CanBeAccessedByOwnerRepo(ownerID, repoID int64) bool {
165
- if p.Type == TypeOrganization {
166
- 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
167
168
- return p.OwnerID == ownerID && p.RepoID == repoID
+ return p.OwnerID == ownerID && p.RepoID == 0
169
170
171
func init() {
0 commit comments