-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuring AuthorizeSiteAccess
plug site param
#4597
Conversation
348e4c1
to
8907b2a
Compare
end | ||
|
||
defp get_site_with_role(conn, current_user, conn_params_domain_accessor) do | ||
domain = get_domain_from_conn(conn, conn_params_domain_accessor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the param is not provided at all (site_id
, for instance), the plug will crash when executing the query, AFAICT. Is site_id
optional here? If not, perhaps we should return 404, like in other cases?
@@ -12,7 +12,7 @@ defmodule PlausibleWeb.Plugs.AuthorizeSiteAccess do | |||
|
|||
def init([]), do: @all_roles | |||
|
|||
def init(allowed_roles) do | |||
def init(allowed_roles) when is_list(allowed_roles) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
8907b2a
to
76085fa
Compare
test/plausible_web/controllers/api/internal_controller/docs_query_test.exs
Outdated
Show resolved
Hide resolved
1069f23
to
250c083
Compare
…t body at some key
f4914ed
to
61be182
Compare
|
AuthorizeSiteAccess
plug site param
Changes
Tests
Changelog
Documentation
Dark mode