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 4ea0372 commit a5928a0
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,7 +76,7 @@ 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)
Expand All @@ -90,10 +90,16 @@ defmodule ScreenplayWeb.Router do
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

# Permanent Configuration
Expand Down

0 comments on commit a5928a0

Please sign in to comment.