change to can_manage_volunteers?
This commit is contained in:
parent
85fa39870d
commit
b36d02ceec
2 changed files with 4 additions and 8 deletions
|
|
@ -4,7 +4,7 @@ module Admin
|
||||||
load_and_authorize_resource :conference, find_by: :short_title
|
load_and_authorize_resource :conference, find_by: :short_title
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if can_manage_volunteers(@conference)
|
if can_manage_volunteers?(@conference)
|
||||||
render :index
|
render :index
|
||||||
else
|
else
|
||||||
authorize! :index, :volunteer
|
authorize! :index, :volunteer
|
||||||
|
|
@ -12,7 +12,7 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
if can_manage_volunteers(@conference)
|
if can_manage_volunteers?(@conference)
|
||||||
if @conference.use_vpositions
|
if @conference.use_vpositions
|
||||||
@volunteers = @conference.registrations.joins(:vchoices).uniq
|
@volunteers = @conference.registrations.joins(:vchoices).uniq
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
module Admin
|
module Admin
|
||||||
module VolunteersHelper
|
module VolunteersHelper
|
||||||
def can_manage_volunteers(conference)
|
def can_manage_volunteers?(conference)
|
||||||
if (current_user.has_role? :organizer, conference) || (current_user.has_role? :volunteers_coordinator, conference)
|
!!(current_user.has_role? :organizer, conference) || (current_user.has_role? :volunteers_coordinator, conference)
|
||||||
true
|
|
||||||
else
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue