I am currently using cancan in my web app and so far it works greats but there is a problem I am having regarding nested resources in rails. When accessing the index page cancan does not restrict a user from seeing what another logged in user can see. It works fine for the show pages but when visiting the index page it does not work.
routes.rb
resources :skater do
resources :videos
end
ability.rb
can :manage, Video, :skater => { :user_id => user.id }
video_controller.rb
load_and_authorize_resource :skater
load_and_authorize_resource :video, :through => :current_user
How can I restrict access to another users index view so that user A cant view user B videos?
load_and_authorize_resource
calls you are using. – Baylor Rae'cannot [:read, :show], Video
and it worked but when I try to view my own video it does not work I received the same error as a restricted user. – coletrain