lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Allow admins to resolve removed or deleted objects via API

Open Nothing4You opened this issue 1 year ago • 4 comments

Nothing4You avatar Sep 27 '24 02:09 Nothing4You

Is there a reason why everyone isn't allowed to resolve removed comments? Removed comments are still returned by the API when you query the comment endpoint, but they can't be resolved directly with resolve_object

Sjmarf avatar Oct 15 '24 09:10 Sjmarf

@Sjmarf If removed comments are returned when youre not a mod/admin thats a bug. Are you using the latest release?

Nutomic avatar Oct 16 '24 08:10 Nutomic

@Nutomic

I tried it on sh.itjust.works (0.19.5) and lemmy.ml (0.19.6-beta1). On both instances I can use the comment endpoint to get a removed comment like so:

https://sh.itjust.works/api/v3/comment?id=14436827

But I can't use resolve_object:

https://sh.itjust.works/api/v3/resolve_object?q=https://sh.itjust.works/comment/14436827

Is this limitation intentional? It seems to me that they should either both return the object, or neither should return the object. When the comment is local this isn't a huge issue because the comment endpoint can be used instead of resolve_object, but it gets tricky when I'm trying to resolve an object from a non-local instance.

Sjmarf avatar Oct 16 '24 12:10 Sjmarf

with the changes in this PR comments will be resolvable by users as well, as the additional check within the resolve api no longer exists, and it just uses the underlying check when retrieving the comment.

only comment metadata is returned though, not comment contents, which is the same way it works on the comment api.

Nothing4You avatar Oct 16 '24 13:10 Nothing4You

@Nothing4You bump on this one: https://github.com/Nothing4You/lemmy/pull/5 , then we can approve and merge this.

dessalines avatar Oct 22 '24 20:10 dessalines

merged to unblock this PR, refactoring can then be done separately

Nothing4You avatar Oct 22 '24 22:10 Nothing4You