mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
fix permissions
This commit is contained in:
parent
4f3390f728
commit
993658ce0e
2 changed files with 3 additions and 0 deletions
|
@ -161,6 +161,8 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do
|
|||
when action in [:show, :index],
|
||||
do: true
|
||||
|
||||
def can?(_user, :show, %Tag{}), do: true
|
||||
|
||||
# Comment on images where that is allowed
|
||||
def can?(_user, :create_comment, %Image{hidden_from_users: false, commenting_allowed: true}), do: true
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ defmodule PhilomenaWeb.TagController do
|
|||
alias Philomena.Interactions
|
||||
|
||||
plug PhilomenaWeb.RecodeParameterPlug, [name: "id"] when action in [:show]
|
||||
plug PhilomenaWeb.CanaryMapPlug, update: :edit
|
||||
plug :load_and_authorize_resource, model: Tag, id_field: "slug", only: [:show, :edit, :update, :delete], preload: [:aliases, :implied_tags, :implied_by_tags, :dnp_entries, public_links: :user]
|
||||
|
||||
def index(conn, params) do
|
||||
|
|
Loading…
Reference in a new issue