cancan only works with current_user method. I dont no if there is a way to customize this
the code example below can guide you through managing contents by only the owner
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest user (not logged in)
if user.admin?
can :manage, :all
else
can :read, Content
end
if user
can :create, Content
can :manage, Content do |content|
content.try(:user) == user
end
end
end
end