mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-20 06:37:59 +01:00
fix permission error
This commit is contained in:
parent
67ac0318f7
commit
37a2d014cd
2 changed files with 2 additions and 1 deletions
|
@ -38,6 +38,7 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do
|
|||
|
||||
# Show details of profiles and view user list
|
||||
def can?(%User{role: "moderator"}, :show_details, %User{}), do: true
|
||||
def can?(%User{role: "moderator"}, :edit_description, %User{}), do: true
|
||||
def can?(%User{role: "moderator"}, :index, User), do: true
|
||||
|
||||
# View filters
|
||||
|
|
|
@ -6,7 +6,7 @@ defmodule PhilomenaWeb.Profile.DescriptionController do
|
|||
|
||||
plug PhilomenaWeb.FilterBannedUsersPlug
|
||||
plug PhilomenaWeb.CanaryMapPlug, edit: :edit_description, update: :edit_description
|
||||
plug :load_resource, model: User, id_name: "profile_id", id_field: "slug", persisted: true
|
||||
plug :load_and_authorize_resource, model: User, id_name: "profile_id", id_field: "slug", persisted: true
|
||||
|
||||
def edit(conn, _params) do
|
||||
changeset = Users.change_user(conn.assigns.user)
|
||||
|
|
Loading…
Reference in a new issue