From eebd9838f067369031af9770b899f75f30810549 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Mar 2021 17:18:18 +0100 Subject: Add filter hook to forbid embed access --- server/tests/fixtures/peertube-plugin-test/main.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'server/tests/fixtures/peertube-plugin-test/main.js') diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index 9913d0846..dfcc874d4 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js @@ -210,6 +210,26 @@ async function register ({ registerHook, registerSetting, settingsManager, stora return result } }) + + registerHook({ + target: 'filter:html.embed.video.allowed.result', + handler: (result, params) => { + return { + allowed: false, + html: 'Lu Bu' + } + } + }) + + registerHook({ + target: 'filter:html.embed.video-playlist.allowed.result', + handler: (result, params) => { + return { + allowed: false, + html: 'Diao Chan' + } + } + }) } async function unregister () { -- cgit v1.2.3