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