emails: add /emails index page.
Add emails index page at https://danbooru.donmai.us/emails. Mods can use this page to view and search emails belonging to users below mod level.
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
class EmailAddressPolicy < ApplicationPolicy
|
||||
def index?
|
||||
user.is_moderator?
|
||||
end
|
||||
|
||||
def show?
|
||||
record.user_id == user.id || (user.is_moderator? && record.user.level < user.level)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user