Merge pull request #4527 from BrokenEagle/forum-post-voting

Prevent creators from voting on their own BURs
This commit is contained in:
evazion
2020-06-23 02:42:46 -05:00
committed by GitHub

View File

@@ -24,7 +24,7 @@ class ForumPostPolicy < ApplicationPolicy
end
def votable?
unbanned? && show? && record.bulk_update_request.present? && record.bulk_update_request.is_pending?
unbanned? && show? && record.bulk_update_request.present? && record.bulk_update_request.is_pending? && record.bulk_update_request.user_id != user.id
end
def reportable?