From 551868000825ebbe037b1be494679b24c2f0fcac Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 18 Apr 2019 22:08:26 +0200 Subject: Added better setup process redirection Co-authored-by: LarsVomMars --- src/main/kotlin/DatabaseController.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/kotlin/DatabaseController.kt') diff --git a/src/main/kotlin/DatabaseController.kt b/src/main/kotlin/DatabaseController.kt index c21b175..51179e8 100644 --- a/src/main/kotlin/DatabaseController.kt +++ b/src/main/kotlin/DatabaseController.kt @@ -185,15 +185,15 @@ class DatabaseController(dbFileLocation: String = "main.db") { val userRoles = mutableListOf() RolesData.select { RolesData.id eq userRoleId }.map { it[RolesData.role] }.forEach { - when (it) { - "GUEST" -> { + when (Roles.valueOf(it)) { + Roles.GUEST -> { userRoles.add(Roles.GUEST) } - "USER" -> { + Roles.USER -> { userRoles.add(Roles.GUEST) userRoles.add(Roles.USER) } - "ADMIN" -> { + Roles.ADMIN -> { userRoles.add(Roles.GUEST) userRoles.add(Roles.USER) userRoles.add(Roles.ADMIN) -- cgit v1.2.3