mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
allow indexing forums
This commit is contained in:
parent
d3ea63da01
commit
8cc2fd763c
3 changed files with 3 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in a new issue