Skip to content

When you define an instance level ability and you check can? Class, it still returns true #972

Open
mooktakim opened this Issue Dec 10, 2013 · 0 comments

1 participant

@mooktakim
class Ability
  include CanCan::Ability
  def initialize(user)
    if user
      can :update, User, id: current_user.id
    end
  end
end

This is working:

can? :update, User.find(1)

This is not working:

can? :update, User

I expected this to return false since I haven't added any rules on the class.
Is this not the expected behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.