Class: Marley::Joints::Messages::Resources::PublicMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/marley/joints/messages.rb

Instance Method Summary collapse

Methods inherited from Message

#author, #reply, #validate

Instance Method Details

#actions(parent_instance = nil) ⇒ Object



75
76
77
78
79
80
81
# File 'lib/marley/joints/messages.rb', line 75

def actions(parent_instance=nil)
  if current_user_role=='owner' && ! self.new?
    {:delete => self.url}.update(super || {})
  else
    super
  end
end

#current_user_roleObject



72
73
74
# File 'lib/marley/joints/messages.rb', line 72

def current_user_role
  super || 'reader' 
end