+ alias Pleroma.Web.Plugs.OAuthScopesPlug
+
+ @oauth_read_actions [:show, :index]
+
+ plug(Pleroma.Web.ApiSpec.CastAndValidate)
+ plug(OAuthScopesPlug, %{scopes: ["read:filters"]} when action in @oauth_read_actions)
+
+ plug(
+ OAuthScopesPlug,
+ %{scopes: ["write:filters"]} when action not in @oauth_read_actions
+ )
+
+ defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.FilterOperation