e621ng / e621ng

e621.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`locked_tags` parameter inconsistency for moderators

faucetlol opened this issue · comments

commented

The locked tags input is shown on the uploader to users ranked moderator+

allowLockedTags: <%= CurrentUser.is_moderator?.to_json %>,

But the parameter itself is only permitted for admin+

permitted_params << :locked_tags if CurrentUser.is_admin?

The presence of the locked tags input causes any attempted upload by a moderator (using the default form, at least) to fail with the message Error: found unpermitted parameter: :locked_tags.

However, moderators are able to lock tags on pre-existing posts.

permitted_params += %i[is_status_locked is_comment_disabled locked_tags] if CurrentUser.is_moderator?