Skip to content

Commit

Permalink
fix: enable non-PA-admins to view PA messages
Browse files Browse the repository at this point in the history
fd8fdd5 implemented support for the frontend to display PA message
navigation and read-only views when the current user is not a PA
message admin, but didn't change the authorization requirement on the
relevant routes.
  • Loading branch information
digitalcora committed Feb 3, 2025
1 parent e845d01 commit 34fe33e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/screenplay_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,24 @@ defmodule ScreenplayWeb.Router do
# PA Message Management

scope "/pa-messages", ScreenplayWeb do
pipe_through([:browser, :authenticate, :ensure_pa_message_admin])
pipe_through([:browser, :authenticate])

get("/", PaMessagesController, :index)
get("/new", PaMessagesController, :index)
get("/:id/edit", PaMessagesController, :index)
end

scope "/api/pa-messages", ScreenplayWeb do
pipe_through([:api, :authenticate, :ensure_pa_message_admin])
pipe_through([:api, :authenticate])

get("/preview_audio", PaMessagesApiController, :preview_audio)
resources("/", PaMessagesApiController, only: [:index, :show, :create, :update])
resources("/", PaMessagesApiController, only: [:index, :show])
end

scope "/api/pa-messages", ScreenplayWeb do
pipe_through([:api, :authenticate, :ensure_pa_message_admin])

resources("/", PaMessagesApiController, only: [:create, :update])
end

scope "/api/pa-messages", ScreenplayWeb do
Expand Down

0 comments on commit 34fe33e

Please sign in to comment.