Skip to content

Conversation

@draaglom
Copy link
Contributor

@draaglom draaglom commented Oct 29, 2024

until now, we were incorrectly showing 'edit' in the dropdown menu on other people's comments when they were a reply to your comment.

this was because:

  • we passed down a single permissions object recursively which represented the amalgam of 'you can edit because you run the project' and alseo 'you can edit because this was your comment'
  • we set that permission to an edit-allowing one any time a comment you create is found in the tree and never unset it (and indeed we couldn't unset it, without also having the context re: post/project permissions)

instead, we now let each comment determine its own editability directly.

Note that I don't quite know enough of my way around to properly test the curator/admin side yet, but I've tested and the user side works (and the code itself is pretty straightforward)

resolves #1160

draaglom added a commit to draaglom/metaculus that referenced this pull request Oct 30, 2024
@draaglom draaglom force-pushed the draaglom/fix-comment-edit-menu branch 2 times, most recently from c08686a to 81d2b80 Compare October 30, 2024 17:18
until now, we were incorrectly showing 'edit' in the dropdown menu on
other people's comments when they were a reply to your comment.

this was because:
 - we passed down a single permissions object recursively which
   represented the amalgam of 'you can edit because you run the project'
and alseo 'you can edit because this was your comment'
 - we set that permission to an edit-allowing one any time a comment you
   create is found in the tree and never unset it (and indeed we
couldn't unset it, without also having the context re: post/project
permissions)

instead, we now let each comment determine its own editability directly.

Note that:

1. this adds the edit option to comments on your profile comment feed,
   which is a slight change of behaviour. I started to remove that again
but then thought maybe it's desirable to keep? so thought I'd ask first
2. I don't quite know enough of my way around to properly test the
   curator/admin side yet, but I've tested and the user side works (and
the code itself is pretty straightforward)

resolves Metaculus#1160
@draaglom draaglom force-pushed the draaglom/fix-comment-edit-menu branch from 81d2b80 to 4efa369 Compare October 30, 2024 17:21
@draaglom draaglom requested a review from hlbmtc October 30, 2024 17:23
Copy link
Contributor

@hlbmtc hlbmtc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hlbmtc hlbmtc merged commit caf0d92 into Metaculus:main Oct 31, 2024
@draaglom draaglom deleted the draaglom/fix-comment-edit-menu branch October 31, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

It looks as if you can edit other people's replies to your comments (FE only)

2 participants