mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
parent
d76f1d6fdb
commit
9d0d622fbd
2 changed files with 4 additions and 0 deletions
|
@ -121,6 +121,9 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do
|
|||
# Revert tag changes
|
||||
def can?(%User{role: "moderator"}, :revert, TagChange), do: true
|
||||
|
||||
# Manage commissions
|
||||
def can?(%User{role: "moderator"}, _action, %Commission{}), do: true
|
||||
|
||||
# And some privileged moderators can...
|
||||
|
||||
# Manage site notices
|
||||
|
|
|
@ -136,6 +136,7 @@ defmodule PhilomenaWeb.Profile.CommissionController do
|
|||
|
||||
case conn.assigns.current_user do
|
||||
%{id: ^user_id} -> conn
|
||||
%{role: role} when role in ["admin", "moderator"] -> conn
|
||||
_other -> PhilomenaWeb.NotAuthorizedPlug.call(conn)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue