Add load_and_authorize_resource to videos controller
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user