|
|
@@ -151,18 +151,19 @@ func DownloadUserIsOrgOrCollaboration(ctx *context.Context, attach *models.Attac |
|
|
|
log.Info("query repo error.") |
|
|
|
} else { |
|
|
|
repo.GetOwner() |
|
|
|
if repo.Owner.IsOrganization() { |
|
|
|
//log.Info("ower is org.") |
|
|
|
if repo.Owner.IsUserPartOfOrg(ctx.User.ID) { |
|
|
|
log.Info("org user may visit the attach.") |
|
|
|
if ctx.User != nil { |
|
|
|
if repo.Owner.IsOrganization() { |
|
|
|
if repo.Owner.IsUserPartOfOrg(ctx.User.ID) { |
|
|
|
log.Info("org user may visit the attach.") |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
isCollaborator, _ := repo.IsCollaborator(ctx.User.ID) |
|
|
|
if isCollaborator { |
|
|
|
log.Info("Collaborator user may visit the attach.") |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
isCollaborator, _ := repo.IsCollaborator(ctx.User.ID) |
|
|
|
if isCollaborator { |
|
|
|
log.Info("Collaborator user may visit the attach.") |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return false |
|
|
|