|
|
@@ -22,20 +22,6 @@ func MustEnableDataset(ctx *context.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func filterPrivateAttachments(ctx *context.Context, list []*models.Attachment) []*models.Attachment { |
|
|
|
if ctx.Repo.CanWrite(models.UnitTypeDatasets) { |
|
|
|
return list |
|
|
|
} else { |
|
|
|
var publicList []*models.Attachment |
|
|
|
for _, attach := range list { |
|
|
|
if !attach.IsPrivate { |
|
|
|
publicList = append(publicList, attach) |
|
|
|
} |
|
|
|
} |
|
|
|
return publicList |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func newFilterPrivateAttachments(ctx *context.Context, list []*models.Attachment, repo *models.Repository) []*models.Attachment { |
|
|
|
|
|
|
|
if ctx.Repo.CanWrite(models.UnitTypeDatasets) { |
|
|
|