aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures/peertube-plugin-test-four
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-four')
-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}