X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FCreateSonePage.kt;h=a0fe7cb0a509127199da175aebd0ce561e7483e0;hb=50df1b89ec5ffdda556713c18e5e67365b84b41a;hp=efa6f1dc8a346ab928aefdb36274bf0ff957f6ee;hpb=3cb0e2c78bb37f2d70ecde92ad4fcf642de788a3;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt index efa6f1d..a0fe7cb 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt @@ -9,12 +9,13 @@ import net.pterodactylus.util.template.Template import net.pterodactylus.util.template.TemplateContext import java.util.logging.Level import java.util.logging.Logger +import javax.inject.Inject /** * The “create Sone” page lets the user create a new Sone. */ -class CreateSonePage(template: Template, webInterface: WebInterface): - SoneTemplatePage("createSone.html", template, "Page.CreateSone.Title", webInterface, false) { +class CreateSonePage @Inject constructor(template: Template, webInterface: WebInterface): + SoneTemplatePage("createSone.html", webInterface, template, "Page.CreateSone.Title") { private val logger = Logger.getLogger(CreateSonePage::class.java.name) @@ -36,7 +37,7 @@ class CreateSonePage(template: Template, webInterface: WebInterface): } override fun isEnabled(toadletContext: ToadletContext) = - if (webInterface.core.preferences.isRequireFullAccess && !toadletContext.isAllowedFullAccess) { + if (webInterface.core.preferences.requireFullAccess && !toadletContext.isAllowedFullAccess) { false } else { (getCurrentSone(toadletContext) == null) || (webInterface.core.localSones.size == 1)