FIX: Return 422 when creating topics with tags w/out permission (PR #10400)

The UI prevents users from trying to create tags on topics when they don’t have permission, but if you are trying to add tags to a topic via the API and you don’t have permission before this change it would silently succeed in creating the topic, but it wouldn’t have any tags.

Now a 422 error will be returned with an error message when trying to create a topic with tags when tagging is disabled or you don’t have enough trust level to add tags to a topic.

Bug report:


This pull request has been mentioned on Discourse Meta. There might be relevant details there:

@nlalonde can you review?