hide emails from unauthorized mods (fix #34)

This commit is contained in:
Luna D 2020-10-19 21:10:48 +02:00
parent 1436c7ff06
commit 91c6b1f659
No known key found for this signature in database
GPG key ID: 81AF416F2CC36FC8

View file

@ -46,7 +46,10 @@ h1 Users
- true -> - true ->
td td
= if can?(@conn, :edit, Philomena.Users.User) do
= user.email = user.email
- else
i N/A
td td
= cond do = cond do
@ -67,8 +70,10 @@ h1 Users
= pretty_time user.created_at = pretty_time user.created_at
td td
=> link "Edit", to: Routes.admin_user_path(@conn, :edit, user) = if can?(@conn, :edit, Philomena.Users.User) do
' • => link to: Routes.admin_user_path(@conn, :edit, user) do
i.fa.fa-fw.fa-user-edit
' Edit
/= if user.deleted_at do /= if user.deleted_at do
/ => link_to 'Reactivate', admin_user_activation_path(user), data: { confirm: t('are_you_sure') }, method: :create / => link_to 'Reactivate', admin_user_activation_path(user), data: { confirm: t('are_you_sure') }, method: :create
@ -76,9 +81,14 @@ h1 Users
/ => link_to 'Deactivate', admin_user_activation_path(user), data: { confirm: t('are_you_sure') }, method: :delete / => link_to 'Deactivate', admin_user_activation_path(user), data: { confirm: t('are_you_sure') }, method: :delete
/' • /' •
=> link "Ban", to: Routes.admin_user_ban_path(@conn, :new, username: user.name) = if can?(@conn, :index, Philomena.Bans.User) do
' • => link to: Routes.admin_user_ban_path(@conn, :new, username: user.name) do
=> link "Add link", to: Routes.profile_user_link_path(@conn, :new, user) i.fa.fa-fw.fa-ban
' Ban
= if can?(@conn, :edit, Philomena.UserLinks.UserLink) do
=> link to: Routes.profile_user_link_path(@conn, :new, user) do
i.fa.fa-fw.fa-link
' Add link
.block__header.block__header--light .block__header.block__header--light
= pagination = pagination