diff --git a/app/controllers/admin/poll/questions/answers/videos_controller.rb b/app/controllers/admin/poll/questions/answers/videos_controller.rb index e4191e0dd..c198540b1 100644 --- a/app/controllers/admin/poll/questions/answers/videos_controller.rb +++ b/app/controllers/admin/poll/questions/answers/videos_controller.rb @@ -1,6 +1,6 @@ class Admin::Poll::Questions::Answers::VideosController < Admin::Poll::BaseController - load_resource :answer, class: "::Poll::Question::Answer" - load_resource class: "::Poll::Question::Answer::Video", through: :answer + load_and_authorize_resource :answer, class: "::Poll::Question::Answer" + load_and_authorize_resource class: "::Poll::Question::Answer::Video", through: :answer def index end diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb index 4fb5474cf..57cef7552 100644 --- a/app/models/abilities/administrator.rb +++ b/app/models/abilities/administrator.rb @@ -91,6 +91,7 @@ module Abilities can [:read, :create, :update], Poll::Question can :destroy, Poll::Question can :manage, Poll::Question::Answer + can :manage, Poll::Question::Answer::Video can :manage, SiteCustomization::Page can :manage, SiteCustomization::Image diff --git a/spec/models/abilities/administrator_spec.rb b/spec/models/abilities/administrator_spec.rb index 71a12ad71..6ba8c79ff 100644 --- a/spec/models/abilities/administrator_spec.rb +++ b/spec/models/abilities/administrator_spec.rb @@ -116,6 +116,8 @@ describe Abilities::Administrator do it { should be_able_to(:manage, Poll::Question::Answer) } + it { should be_able_to(:manage, Poll::Question::Answer::Video) } + it { is_expected.to be_able_to :manage, Dashboard::AdministratorTask } it { is_expected.to be_able_to :manage, dashboard_administrator_task }