From 8cbf36c5b39c5cd514417dfe5f726e57478aa35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Z=C3=BCrcher?= Date: Sun, 30 Nov 2025 21:10:16 +0100 Subject: [PATCH] add new user database creation indicator --- go.mod | 2 +- go.sum | 4 ++-- handlers/access.go | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index c6db292..57eef1a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module gitea.tecamino.com/paadi/access-handler go 1.24.5 require ( - gitea.tecamino.com/paadi/dbHandler v1.1.7 + gitea.tecamino.com/paadi/dbHandler v1.1.8 gitea.tecamino.com/paadi/tecamino-logger v0.2.1 github.com/gin-gonic/gin v1.11.0 github.com/go-playground/assert/v2 v2.2.0 diff --git a/go.sum b/go.sum index ca1d509..3efa24d 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -gitea.tecamino.com/paadi/dbHandler v1.1.7 h1:NqVbxbUwd7EZX6HYntyLYwwPbyTPevOhIBTFqoCVqOU= -gitea.tecamino.com/paadi/dbHandler v1.1.7/go.mod h1:y/xn/POJg1DO++67uKvnO23lJQgh+XFQq7HZCS9Getw= +gitea.tecamino.com/paadi/dbHandler v1.1.8 h1:8iB3vunMyb9M/nYzErmvU/CjhY6IZt8aRGQryeGiO+c= +gitea.tecamino.com/paadi/dbHandler v1.1.8/go.mod h1:y/xn/POJg1DO++67uKvnO23lJQgh+XFQq7HZCS9Getw= gitea.tecamino.com/paadi/tecamino-logger v0.2.1 h1:sQTBKYPdzn9mmWX2JXZBtGBvNQH7cuXIwsl4TD0aMgE= gitea.tecamino.com/paadi/tecamino-logger v0.2.1/go.mod h1:FkzRTldUBBOd/iy2upycArDftSZ5trbsX5Ira5OzJgM= github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ= diff --git a/handlers/access.go b/handlers/access.go index ab36ed6..6632e45 100644 --- a/handlers/access.go +++ b/handlers/access.go @@ -15,8 +15,9 @@ import ( // authentication and authorization operations can be performed // consistently across the application. type AccessHandler struct { - dbHandler *dbHandler.DBHandler // Database handler used for managing users and roles - logger *logging.Logger // Centralized application logger + dbHandler *dbHandler.DBHandler // Database handler used for managing users and roles + logger *logging.Logger // Centralized application logger + NewDBCreated bool // inticator new user db created } // NewAccessHandler @@ -81,6 +82,9 @@ func NewAccessHandler(path string, logger *logging.Logger) (aH *AccessHandler, e return } + //indicator that user database was created + aH.NewDBCreated = aH.dbHandler.NewCreatedDB + logger.Debug("NewAccessHandler", "add default role") // Add default roles to the system err = aH.AddDefaultRole()