Prevent anon/banned/member users from voting (fix #2719).

There was a regression in 6d6d00b; `before_filter :voter_only` was a
no-op in the post vote controller because it merely returned false,
which does not halt the request. The fix is to arrange for a voter_only
method to be defined that properly redirects to the access denied page.
This commit is contained in:
evazion
2016-10-14 04:40:48 +00:00
parent 5e75dcecea
commit d84184b5f1
3 changed files with 17 additions and 9 deletions

View File

@@ -14,10 +14,4 @@ class PostVotesController < ApplicationController
rescue PostVote::Error => x
@error = x
end
protected
def voter_only
CurrentUser.is_voter?
end
end