From b7e07b099a3bcb8b63ca16d1e27e7d607bb94afb Mon Sep 17 00:00:00 2001 From: Luna D Date: Sun, 8 Dec 2019 17:03:26 -0500 Subject: [PATCH 1/2] use correct permissions --- lib/philomena/duplicate_reports.ex | 2 +- lib/philomena/reports.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/philomena/duplicate_reports.ex b/lib/philomena/duplicate_reports.ex index 68ea318c..046ba3e2 100644 --- a/lib/philomena/duplicate_reports.ex +++ b/lib/philomena/duplicate_reports.ex @@ -116,7 +116,7 @@ defmodule Philomena.DuplicateReports do end def count_duplicate_reports(user) do - if Canada.Can.can?(user, :manage, DuplicateReport) do + if Canada.Can.can?(user, :edit, DuplicateReport) do DuplicateReport |> where(state: "open") |> Repo.aggregate(:count, :id) diff --git a/lib/philomena/reports.ex b/lib/philomena/reports.ex index 2363f633..d7e14102 100644 --- a/lib/philomena/reports.ex +++ b/lib/philomena/reports.ex @@ -118,7 +118,7 @@ defmodule Philomena.Reports do end def count_reports(user) do - if Canada.Can.can?(user, :manage, Report) do + if Canada.Can.can?(user, :index, Report) do Report |> where(open: true) |> Repo.aggregate(:count, :id) From e303506e12c48825a79bb6e27b0106dff528bcb2 Mon Sep 17 00:00:00 2001 From: Luna D Date: Sun, 8 Dec 2019 17:06:09 -0500 Subject: [PATCH 2/2] i don't know whose idea was to call it this way --- lib/philomena_web/templates/image/_options.html.slime | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/philomena_web/templates/image/_options.html.slime b/lib/philomena_web/templates/image/_options.html.slime index f907c5ec..b82a3997 100644 --- a/lib/philomena_web/templates/image/_options.html.slime +++ b/lib/philomena_web/templates/image/_options.html.slime @@ -17,7 +17,7 @@ | Replace a href="#" data-click-tab="administration" i.fa.fa-toolbox> - | Administrate + | Manage = if present?(@image.scratchpad) do i.fa.fa-sticky-note.fa--important< i.fa.fa-exclamation.fa--important @@ -89,4 +89,4 @@ = submit "Delete", class: "button button--state-danger button--separate-left" - else - = button_to "Restore", Routes.image_delete_path(@conn, :delete, @image), method: "delete", class: "button button--state-success" \ No newline at end of file + = button_to "Restore", Routes.image_delete_path(@conn, :delete, @image), method: "delete", class: "button button--state-success"