working commit
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"mbase/app/descriptor"
|
||||
"mbase/app/descr"
|
||||
"mbase/pkg/auxid"
|
||||
"mbase/pkg/auxpwd"
|
||||
"mbase/pkg/mbctl"
|
||||
@@ -39,7 +39,7 @@ func (lg *Logic) CreateAccount(ctx context.Context, accountID int64, params *mbc
|
||||
lg.WaitDumping()
|
||||
lg.WaitRestoring()
|
||||
|
||||
grantExists, _, err := lg.db.GetGrant(ctx, accountID, descriptor.GrantModifyUsers)
|
||||
grantExists, _, err := lg.db.GetGrant(ctx, accountID, descr.GrantModifyUsers)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
@@ -67,7 +67,7 @@ func (lg *Logic) CreateAccount(ctx context.Context, accountID int64, params *mbc
|
||||
}
|
||||
now := time.Now().Format(time.RFC3339)
|
||||
passhash := auxpwd.MakeSHA256Hash([]byte(params.Password))
|
||||
accountDescr := &descriptor.Account{
|
||||
accountDescr := &descr.Account{
|
||||
ID: auxid.GenID(),
|
||||
Username: params.Username,
|
||||
Passhash: passhash,
|
||||
@@ -90,7 +90,7 @@ func (lg *Logic) UpdateAccount(ctx context.Context, accountID int64, params *mbc
|
||||
lg.WaitRestoring()
|
||||
lg.WaitDumping()
|
||||
|
||||
grantExists, _, err := lg.db.GetGrant(ctx, accountID, descriptor.GrantModifyUsers)
|
||||
grantExists, _, err := lg.db.GetGrant(ctx, accountID, descr.GrantModifyUsers)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
@@ -99,7 +99,7 @@ func (lg *Logic) UpdateAccount(ctx context.Context, accountID int64, params *mbc
|
||||
return res, err
|
||||
}
|
||||
|
||||
var accountDescr *descriptor.Account
|
||||
var accountDescr *descr.Account
|
||||
var accountExists bool
|
||||
switch {
|
||||
case params.AccountID != 0:
|
||||
@@ -147,7 +147,7 @@ func (lg *Logic) DeleteAccount(ctx context.Context, accountID int64, params *mbc
|
||||
lg.WaitDumping()
|
||||
lg.WaitRestoring()
|
||||
|
||||
grantExists, _, err := lg.db.GetGrant(ctx, accountID, descriptor.GrantModifyUsers)
|
||||
grantExists, _, err := lg.db.GetGrant(ctx, accountID, descr.GrantModifyUsers)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
@@ -156,7 +156,7 @@ func (lg *Logic) DeleteAccount(ctx context.Context, accountID int64, params *mbc
|
||||
return res, err
|
||||
}
|
||||
|
||||
var accountDescr *descriptor.Account
|
||||
var accountDescr *descr.Account
|
||||
var accountExists bool
|
||||
switch {
|
||||
case params.AccountID != 0:
|
||||
@@ -194,7 +194,7 @@ func (lg *Logic) ListAccounts(ctx context.Context, accountID int64, params *mbct
|
||||
|
||||
lg.WaitRestoring()
|
||||
|
||||
grantExists, _, err := lg.db.GetGrant(ctx, accountID, descriptor.GrantModifyUsers)
|
||||
grantExists, _, err := lg.db.GetGrant(ctx, accountID, descr.GrantModifyUsers)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user