|
# frozen_string_literal: true
|
|
|
|
class Ability
|
|
include CanCan::Ability
|
|
|
|
def initialize(user)
|
|
can :create, Conversation
|
|
can :read, Conversation, user: user
|
|
can :create, Message, conversation: { user: user }
|
|
can %i[index read], Message, conversation: { user: user }
|
|
end
|
|
end
|