From cf5bb85cede5b05b58ed2b40460d0b913e8b2cf6 Mon Sep 17 00:00:00 2001 From: jloup Date: Sun, 13 May 2018 15:47:59 +0100 Subject: User roles. --- db/user.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'db/user.go') diff --git a/db/user.go b/db/user.go index 64ca6a6..24ce491 100644 --- a/db/user.go +++ b/db/user.go @@ -11,10 +11,16 @@ const ( AwaitingConfirmation ) +type UserRole string + +const RoleUser UserRole = "user" +const RoleAdmin UserRole = "admin" + type User struct { Id int64 - Email string `sql:",unique,notnull"` - PasswordHash string `sql:",notnull"` + Role UserRole + Email string + PasswordHash string OtpSecret string IsOtpSetup bool Status UserStatus -- cgit v1.2.3