right type used

This commit is contained in:
2026-02-20 15:28:26 +02:00
parent 8546ad496f
commit 1c8f6f142c
18 changed files with 146 additions and 144 deletions
+6 -6
View File
@@ -17,8 +17,8 @@ import (
"mstore/app/router"
"mstore/pkg/auxhttp"
"mstore/pkg/auxpwd"
"mstore/pkg/auxuuid"
"mstore/pkg/terms"
"mstore/pkg/uuid"
)
const (
@@ -44,12 +44,12 @@ func (hand *Handler) AuthMiddleware(next router.Handler) router.Handler {
}
// Authentification
func (hand *Handler) CheckAccess(rctx *router.Context) (bool, auxuuid.UUID, error) {
func (hand *Handler) CheckAccess(rctx *router.Context) (bool, uuid.UUID, error) {
var err error
var success bool
var username string
var password string
var accountID auxuuid.UUID
var accountID uuid.UUID
accountID = terms.AnonymousID
@@ -80,9 +80,9 @@ anonymous:
return success, accountID, err
}
func (hand *Handler) ValidatePassword(ctx context.Context, username, password string) (bool, auxuuid.UUID, error) {
func (hand *Handler) ValidatePassword(ctx context.Context, username, password string) (bool, uuid.UUID, error) {
var err error
var accountID auxuuid.UUID
var accountID uuid.UUID
valid := false
accountExists, accountDescr, err := hand.mdb.GetAccountByUsername(ctx, username)
@@ -102,7 +102,7 @@ func (hand *Handler) ValidatePassword(ctx context.Context, username, password st
// Authorization
func (hand *Handler) CheckRight(ctx context.Context, accountID auxuuid.UUID, reqRight, subject string) (bool, error) {
func (hand *Handler) CheckRight(ctx context.Context, accountID uuid.UUID, reqRight terms.Right, subject string) (bool, error) {
var err error
var res bool
//hand.logg.Debugf("Cop check your right %s: %s %s", accountID, reqRight, subject)