mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
FIX: PostActionCreator
was not checking the guardian properly
It also exposed a bug in the EmailReceiver spec, where a test had a user liking their own post and was not failing.
This commit is contained in:
@ -7,7 +7,7 @@ class PostActionCreator
|
||||
end
|
||||
|
||||
def perform(action)
|
||||
guardian.ensure_post_can_act!(@post, action, opts: {
|
||||
guardian.ensure_post_can_act!(@post, PostActionType.types[action], opts: {
|
||||
taken_actions: PostAction.counts_for([@post].compact, @user)[@post&.id]
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user