Allow changing the visibitly (public/privat) of messages (fixes #625)
This commit is contained in:
parent
c955a6ee40
commit
226192f7cb
6 changed files with 38 additions and 0 deletions
|
|
@ -124,6 +124,12 @@ class Message < ApplicationRecord
|
|||
!private || sender == user || recipients_ids.include?(user.id)
|
||||
end
|
||||
|
||||
def can_toggle_private?(user)
|
||||
return true if sender == user
|
||||
return false if private?
|
||||
user.role_admin?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def create_salt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue