Editing post with tags without tagging permission results in tag removal


(Joshua Rosenfeld) #1

Summary: So the discourse I moderate uses tags, and both the creation and application of tags is limited to TL4 users. Essentially that is just the moderator, admins, and a few long time trustable users. Unfortunately, it seems that if a user edits the OP after a TL4 users has applied tags, the tags are removed.

Steps to reproduce: (using names to make it clearer)

  1. Bob, not a TL4 user creates a post.
  2. Joe, a TL4 user edits the title to include proper tags.
  3. Bob makes an edit to the OP.

Expected Results:
Bob’s edits affect only the post content, tags remain attached.

Actual Results:
Bob’s edits take effect AND remove any tags from the topic.

Unable to attempt repro on try as all users can tag…

See this unlisted topic from my site where I recreated the bug. Notice the 2 edits…
http://discourse.stonehearth.net/t/moderator-tagging-test-v6/17938 (text to prevent oneboxing…)

(Jeff Atwood) #2

Makes sense from a code perspective – that user does not have the right to add those tags. So thus at the time that user saves the post, those ineligible tags are removed. The special case is that tags predating your edit should not be permission checked against the current user.

I remember encountering these cases on Stack Exchange with moderator tags as well @neil.

(Joshua Rosenfeld) #3

I understand that from a permission basis within the code it makes sense,…that doesn’t mean it makes sense from a human/end-user perspective. Was this special case resolved over on Stack Exchange?

(Jeff Atwood) #4

As I said above

Perhaps that was unclear?

(Joshua Rosenfeld) #5

Sorry, no that was very clear. My intention was to agree with your comment.

My question was referring to your use of the word “should.” Agreeing that this should be resolved does not mean it was resolved previously.

(Sam Saffron) #6

We will get it fixed, already have code that protects moderator tags, that is an even tricker case to protect against

(Joshua Rosenfeld) #7

What is a “moderator tag?” I am a moderator…

(Sam Saffron) #8

A tag that only a moderator can apply

Eg Topics tagged planned

You need to be an admin to define the list

(Joshua Rosenfeld) #9

So we would have to “pre-define” every tag…that would work for almost every tag we use, except for the tag we create for each version…would need an admin to add it every time they release a patch.

Thanks for the info, looking forward to a fix! :smile:

(Neil Lalonde) #10

I committed the fix for this. In this case, the post revisor should not be attempting to change the tags at all, so it was a simple fix.

(Jeff Atwood) #11