aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures/peertube-plugin-test-four/main.js
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-22 10:55:28 +0200
committerChocobozzz <me@florianbigard.com>2021-04-22 10:55:28 +0200
commit302eba0d898e38dca14739486441c27c0be6c62f (patch)
tree280d18bfe2ad1b16248277371e609c31d6b3aaa4 /server/tests/fixtures/peertube-plugin-test-four/main.js
parent3e0e8d4afded28559b7c473061bbdc31ab542e1c (diff)
downloadPeerTube-302eba0d898e38dca14739486441c27c0be6c62f.tar.gz
PeerTube-302eba0d898e38dca14739486441c27c0be6c62f.tar.zst
PeerTube-302eba0d898e38dca14739486441c27c0be6c62f.zip
Add data directory for plugins and some helpers
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-four/main.js')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-four/main.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-four/main.js b/server/tests/fixtures/peertube-plugin-test-four/main.js
index ea0599997..6930ac511 100644
--- a/server/tests/fixtures/peertube-plugin-test-four/main.js
+++ b/server/tests/fixtures/peertube-plugin-test-four/main.js
@@ -77,10 +77,31 @@ async function register ({
77 }) 77 })
78 78
79 router.get('/static-route', async (req, res) => { 79 router.get('/static-route', async (req, res) => {
80 const staticRoute = await peertubeHelpers.plugin.getBaseStaticRoute() 80 const staticRoute = peertubeHelpers.plugin.getBaseStaticRoute()
81 81
82 return res.json({ staticRoute }) 82 return res.json({ staticRoute })
83 }) 83 })
84
85 router.get('/router-route', async (req, res) => {
86 const routerRoute = peertubeHelpers.plugin.getBaseRouterRoute()
87
88 return res.json({ routerRoute })
89 })
90
91 router.get('/user', async (req, res) => {
92 const user = peertubeHelpers.user.getAuthUser(res)
93
94 const isAdmin = user.role === 0
95 const isModerator = user.role === 1
96 const isUser = user.role === 2
97
98 return res.json({
99 username: user.username,
100 isAdmin,
101 isModerator,
102 isUser
103 })
104 })
84 } 105 }
85 106
86} 107}