checks for verified users when creating and voting proposals
This commit is contained in:
@@ -4,6 +4,8 @@ class Management::ProposalsController < Management::BaseController
|
||||
include HasOrders
|
||||
include CommentableActions
|
||||
|
||||
before_action :check_verified_user, except: :print
|
||||
|
||||
before_action :set_proposal, only: :vote
|
||||
before_action :parse_search_terms, only: :index
|
||||
|
||||
@@ -39,6 +41,12 @@ class Management::ProposalsController < Management::BaseController
|
||||
Proposal
|
||||
end
|
||||
|
||||
def check_verified_user
|
||||
unless current_user.level_two_or_three_verified?
|
||||
redirect_to management_root_path, alert: 'User is not verified'
|
||||
end
|
||||
end
|
||||
|
||||
#Duplicated in application_controller. Move to a concenrn.
|
||||
def set_proposal_votes(proposals)
|
||||
@proposal_votes = current_user ? current_user.proposal_votes(proposals) : {}
|
||||
|
||||
Reference in New Issue
Block a user