From ea6611a8ee35ded13082a5e2e60980a580623fcf Mon Sep 17 00:00:00 2001 From: Skander Mzali Date: Tue, 26 Mar 2024 10:37:34 -0700 Subject: [PATCH] Add field policy for filtering source_ip in detection --- server/lib/orcasite/radio/detection.ex | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/lib/orcasite/radio/detection.ex b/server/lib/orcasite/radio/detection.ex index d91df4a3..125ddb42 100644 --- a/server/lib/orcasite/radio/detection.ex +++ b/server/lib/orcasite/radio/detection.ex @@ -77,6 +77,17 @@ defmodule Orcasite.Radio.Detection do end end + field_policies do + field_policy [:source_ip] do + authorize_if actor_attribute_equals(:admin, true) + authorize_if actor_attribute_equals(:moderator, true) + end + + field_policy :* do + authorize_if always() + end + end + actions do defaults [:destroy]