allow indexing forums

This commit is contained in:
byte[] 2019-12-04 07:38:57 -05:00
parent d3ea63da01
commit 8cc2fd763c
3 changed files with 3 additions and 2 deletions

View file

@ -82,6 +82,7 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do
def can?(_user, :show, %Comment{hidden_from_users: false}), do: true def can?(_user, :show, %Comment{hidden_from_users: false}), do: true
# View forums # View forums
def can?(_user, :index, Forum), do: true
def can?(_user, :show, %Forum{access_level: "normal"}), do: true def can?(_user, :show, %Forum{access_level: "normal"}), do: true
def can?(_user, :show, %Topic{hidden_from_users: false}), do: true def can?(_user, :show, %Topic{hidden_from_users: false}), do: true

View file

@ -8,7 +8,7 @@ defmodule PhilomenaWeb.NotAuthorizedPlug do
def call(conn, _opts) do def call(conn, _opts) do
conn conn
|> Controller.put_flash(:error, "You can't access that page.") |> Controller.put_flash(:error, "You can't access that page.")
|> Controller.redirect(to: conn.assigns.referrer) |> Controller.redirect(external: conn.assigns.referrer)
|> Conn.halt() |> Conn.halt()
end end
end end

View file

@ -8,7 +8,7 @@ defmodule PhilomenaWeb.NotFoundPlug do
def call(conn, _opts) do def call(conn, _opts) do
conn conn
|> Controller.put_flash(:error, "Couldn't find what you were looking for!") |> Controller.put_flash(:error, "Couldn't find what you were looking for!")
|> Controller.redirect(to: conn.assigns.referrer) |> Controller.redirect(external: conn.assigns.referrer)
|> Conn.halt() |> Conn.halt()
end end
end end