How do you restrict user access so a user can only read their own record?
I've tried:
def initialize(user) can :read, User, :id => user.id
and this:
def initialize(user) can :read, user
but I can still access every user in index and show. I have authorize_resource in the UsersController.
Relevant documentation for reference:https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities
#ruby-on-rails