388c2893d5c9b37f1b367c15b649192f85e5bf76
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / ajax / LoggedInJsonPage.kt
1 package net.pterodactylus.sone.web.ajax
2
3 import net.pterodactylus.sone.data.Sone
4 import net.pterodactylus.sone.web.WebInterface
5 import net.pterodactylus.sone.web.page.FreenetRequest
6
7 /**
8  * Base JSON page for all pages that require the user to be logged in.
9  */
10 open class LoggedInJsonPage(path: String, webInterface: WebInterface) : JsonPage(path, webInterface) {
11
12         final override val requiresLogin = true
13
14         final override fun createJsonObject(request: FreenetRequest) =
15                         createJsonObject(getCurrentSone(request.toadletContext)!!, request)
16
17         open protected fun createJsonObject(currentSone: Sone, request: FreenetRequest): JsonReturnObject =
18                         createErrorJsonObject("not-implemented")
19
20 }