Can't authorize when Controller is on singular

8 views
Skip to first unread message

Marina Limeira

unread,
Sep 8, 2015, 10:54:12 AM9/8/15
to canc...@googlegroups.com
I'm using CanCanCan v.1.11.0, and I have the follow situation:

coop_controller.rb
class CoopController < ApplicationController
  authorize_resource class: false
end

ability.rb
if user.has_coop?
  can :show, :coop
end

But when I'm with a user that has a coop, it's raising CanCan::AccessDenied, I believe that is because my controller's name is on singular. Is that a bug? Or I always need to use on plural?


--
Marina F. Lessa Neto Limeira
Discente de Ciência da Computação - UFAL
Linux User #587272
Reply all
Reply to author
Forward
0 new messages