working commit

This commit is contained in:
2026-06-05 18:35:25 +02:00
parent 16c52424ed
commit 557aea269d
13 changed files with 82 additions and 73 deletions
+10 -10
View File
@@ -5,7 +5,7 @@ import (
"fmt"
"time"
"mbase/app/descriptor"
"mbase/app/descr"
"mbase/pkg/auxid"
"mbase/pkg/mbctl"
)
@@ -16,7 +16,7 @@ func (lg *Logic) SetGrant(ctx context.Context, accountID int64, params *mbctl.Se
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
}
@@ -26,8 +26,8 @@ func (lg *Logic) SetGrant(ctx context.Context, accountID int64, params *mbctl.Se
}
grantTypes := []string{
descriptor.GrantModifyUsers,
descriptor.GrantModifyDatabase,
descr.GrantModifyUsers,
descr.GrantModifyDatabase,
}
var grantOk bool
for _, grantType := range grantTypes {
@@ -41,7 +41,7 @@ func (lg *Logic) SetGrant(ctx context.Context, accountID int64, params *mbctl.Se
return res, err
}
var accountDescr *descriptor.Account
var accountDescr *descr.Account
var accountExists bool
switch {
case params.AccountID != 0:
@@ -69,7 +69,7 @@ func (lg *Logic) SetGrant(ctx context.Context, accountID int64, params *mbctl.Se
return res, err
}
now := time.Now().Format(time.RFC3339)
grantDescr := &descriptor.Grant{
grantDescr := &descr.Grant{
ID: auxid.GenID(),
AccountID: accountDescr.ID,
CreatedAt: now,
@@ -88,7 +88,7 @@ func (lg *Logic) DeleteGrant(ctx context.Context, accountID int64, params *mbctl
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
}
@@ -98,8 +98,8 @@ func (lg *Logic) DeleteGrant(ctx context.Context, accountID int64, params *mbctl
}
grantTypes := []string{
descriptor.GrantModifyUsers,
descriptor.GrantModifyDatabase,
descr.GrantModifyUsers,
descr.GrantModifyDatabase,
}
var grantOk bool
for _, grantType := range grantTypes {
@@ -113,7 +113,7 @@ func (lg *Logic) DeleteGrant(ctx context.Context, accountID int64, params *mbctl
return res, err
}
var accountDescr *descriptor.Account
var accountDescr *descr.Account
var accountExists bool
switch {
case params.AccountID != 0: