fix permissions

This commit is contained in:
byte[] 2019-12-14 16:23:35 -05:00
parent 4f3390f728
commit 993658ce0e
2 changed files with 3 additions and 0 deletions

View file

@ -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

View file

@ -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