mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
require tampering permission to see votes
This commit is contained in:
parent
4e227f1252
commit
389100dae2
2 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ defmodule PhilomenaWeb.Image.FavoriteController do
|
|||
end
|
||||
|
||||
defp load_votes_if_authorized(conn, _opts) do
|
||||
case Canada.Can.can?(conn.assigns.current_user, :hide, conn.assigns.image) do
|
||||
case Canada.Can.can?(conn.assigns.current_user, :tamper, conn.assigns.image) do
|
||||
true ->
|
||||
image = Repo.preload(conn.assigns.image, upvotes: :user, downvotes: :user, hides: :user)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ defmodule PhilomenaWeb.Image.TamperController do
|
|||
alias Philomena.ImageVotes
|
||||
alias Philomena.Repo
|
||||
|
||||
plug PhilomenaWeb.CanaryMapPlug, create: :hide
|
||||
plug PhilomenaWeb.CanaryMapPlug, create: :tamper
|
||||
plug :load_and_authorize_resource, model: Image, id_name: "image_id", persisted: true
|
||||
plug :load_resource, model: User, id_name: "user_id", persisted: true
|
||||
|
||||
|
|
Loading…
Reference in a new issue