Showing survey for users and handling authorization

This commit is contained in:
Shyukri Shyukriev 2016-06-30 13:04:07 +02:00
parent 9ce4ba6f6b
commit 67bccf0195
6 changed files with 44 additions and 6 deletions

View file

@ -92,6 +92,9 @@ class Ability
# can manage the commercials of their own events
can :manage, Commercial, commercialable_type: 'Event', commercialable_id: user.events.pluck(:id)
# can view and reply a survey
can [:show, :reply], Survey, surveyable_type: 'Conference', surveyable_id: user.registrations.pluck(:conference_id)
end
# Abilities for signed in users with roles