diff --git a/routers/repo/dataset.go b/routers/repo/dataset.go index 8b2f2abd3..bdadd2066 100755 --- a/routers/repo/dataset.go +++ b/routers/repo/dataset.go @@ -38,11 +38,14 @@ func newFilterPrivateAttachments(ctx *context.Context, list []*models.Attachment permission = true } } - isCollaborator, _ := repo.IsCollaborator(ctx.User.ID) - if isCollaborator { - log.Info("Collaborator user may visit the attach.") - permission = true + if !permission { + isCollaborator, _ := repo.IsCollaborator(ctx.User.ID) + if isCollaborator { + log.Info("Collaborator user may visit the attach.") + permission = true + } } + var publicList []*models.Attachment for _, attach := range list { if !attach.IsPrivate {