Skip to content

Commit

Permalink
fix: unecessary company CVs controller check (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodiaslobo authored Feb 7, 2024
1 parent 03861aa commit 44cec74
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion lib/safira_web/controllers/cv_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
14 changes: 0 additions & 14 deletions test/safira_web/controllers/cv_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 44cec74

Please sign in to comment.