| @@ -121,8 +121,10 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions) | |||||
| for i := range datasets { | for i := range datasets { | ||||
| if attachment.DatasetID == datasets[i].ID { | if attachment.DatasetID == datasets[i].ID { | ||||
| if opts.StarByMe { | |||||
| if !attachment.IsPrivate{ | |||||
| datasets[i].Attachments = append(datasets[i].Attachments, attachment) | |||||
| }else{ | |||||
| permission, ok := permissionMap[datasets[i].ID] | permission, ok := permissionMap[datasets[i].ID] | ||||
| if !ok { | if !ok { | ||||
| @@ -136,7 +138,7 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions) | |||||
| } | } | ||||
| if !permission { | if !permission { | ||||
| isCollaborator, _ := datasets[i].Repo.IsCollaborator(opts.User.ID) | isCollaborator, _ := datasets[i].Repo.IsCollaborator(opts.User.ID) | ||||
| if isCollaborator { | |||||
| if isCollaborator ||datasets[i].Repo.IsOwnedBy(opts.User.ID){ | |||||
| log.Info("Collaborator user may visit the attach.") | log.Info("Collaborator user may visit the attach.") | ||||
| permission = true | permission = true | ||||
| } | } | ||||
| @@ -147,11 +149,7 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions) | |||||
| if permission { | if permission { | ||||
| datasets[i].Attachments = append(datasets[i].Attachments, attachment) | datasets[i].Attachments = append(datasets[i].Attachments, attachment) | ||||
| } else if !attachment.IsPrivate { | |||||
| datasets[i].Attachments = append(datasets[i].Attachments, attachment) | |||||
| } | } | ||||
| } else { | |||||
| datasets[i].Attachments = append(datasets[i].Attachments, attachment) | |||||
| } | } | ||||
| } | } | ||||