From c0525160096c9a9fbcf95ca327e90c402a9b46eb Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Fri, 11 Mar 2022 11:11:54 -0800 Subject: [PATCH] Grant conference organizers permission to manage surveys Resolves: Failures: 1) Survey as an organizer create a survey Failure/Error: click_link 'New' Capybara::ElementNotFound: Unable to find link "New" # ./spec/features/surveys_spec.rb:18:in `block (3 levels) in ' Failed examples: rspec ./spec/features/surveys_spec.rb:15 # Survey as an organizer create a survey --- .rubocop_todo.yml | 2 +- app/models/admin_ability.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0d9a6f13..4d7b21ab 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -426,7 +426,7 @@ Lint/UriRegexp: # Offense count: 127 # Configuration parameters: IgnoredMethods, CountRepeatedAttributes. Metrics/AbcSize: - Max: 71 + Max: 72 # Offense count: 313 # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. diff --git a/app/models/admin_ability.rb b/app/models/admin_ability.rb index 19d6c4d3..4046d29f 100644 --- a/app/models/admin_ability.rb +++ b/app/models/admin_ability.rb @@ -142,6 +142,10 @@ class AdminAbility can :manage, Room, venue: { conference_id: conf_ids } can :manage, Sponsor, conference_id: conf_ids can :manage, SponsorshipLevel, conference_id: conf_ids + can :manage, Survey, surveyable_type: 'Conference', + surveyable_id: conf_ids + can :manage, SurveyQuestion, survey: { surveyable_type: 'Conference', + surveyable_id: conf_ids } can :manage, Ticket, conference_id: conf_ids can :create, TicketScanning do |ticket_scanning| conf_id = ticket_scanning.physical_ticket.ticket_purchase.conference_id