From 851ffd9f79226aa03a430f8079cbad948f0e4972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lobo?= Date: Tue, 6 Feb 2024 23:18:32 +0000 Subject: [PATCH 1/2] fix: unecessary company cvs controller check --- lib/safira_web/controllers/cv_controller.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/safira_web/controllers/cv_controller.ex b/lib/safira_web/controllers/cv_controller.ex index 3adc7e4d..a62db9d2 100644 --- a/lib/safira_web/controllers/cv_controller.ex +++ b/lib/safira_web/controllers/cv_controller.ex @@ -47,7 +47,7 @@ defmodule SafiraWeb.CVController do company = Accounts.get_company!(company_id) - if Accounts.is_admin(conn) or (curr_company_id == company.id and company.has_cv_access) do + if Accounts.is_admin(conn) or curr_company_id == company.id do zip = Accounts.list_company_attendees(company_id) |> Enum.concat(Accounts.list_staffs()) From c5e1bd7a4424f68ef9327203682b89da75c3c655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lobo?= Date: Tue, 6 Feb 2024 23:24:33 +0000 Subject: [PATCH 2/2] chore: remove outdated test --- test/safira_web/controllers/cv_controller_test.exs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/test/safira_web/controllers/cv_controller_test.exs b/test/safira_web/controllers/cv_controller_test.exs index 77011b5e..d99be7af 100644 --- a/test/safira_web/controllers/cv_controller_test.exs +++ b/test/safira_web/controllers/cv_controller_test.exs @@ -77,20 +77,6 @@ defmodule SafiraWeb.CVControllerTest do (attendee.nickname <> ".pdf") |> String.to_charlist() end - test "company does not have access to CV", %{ - user_company_no_access: user_company, - company_no_access: company, - attendee_with_badge: _attendee - } do - %{conn: conn, user: _user} = api_authenticate(user_company) - - conn = - conn - |> get(Routes.cv_path(conn, :company_cvs, company.id)) - - assert response(conn, 403) - end - test "admin downloads the CVs of a company's attendees", %{ company: company, attendee_with_badge: attendee