dmails: allow site owner to read all mails.

Allow site owner to read dmails sent to other users. This is make it
easier to investigate spam without having to drop into the dev console.
This commit is contained in:
evazion
2020-12-13 21:35:18 -06:00
parent 2e633f84f6
commit eae3c1942d
2 changed files with 6 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ class DmailPolicy < ApplicationPolicy
end
def show?
return true if user.is_owner?
user.is_member? && (record.owner_id == user.id || record.valid_key?(request.params[:key]))
end