working commit

This commit is contained in:
2026-02-20 19:08:26 +02:00
parent f973293315
commit 3220e2d78f
32 changed files with 195 additions and 213 deletions
+12 -12
View File
@@ -8,21 +8,21 @@ import (
"mstore/pkg/auxtool"
"mstore/pkg/descr"
"mstore/pkg/term"
"mstore/pkg/uuid"
"mstore/pkg/auxid"
)
// CreateGrant
type CreateGrantParams struct {
AccountID uuid.UUID `json:"accountID"`
AccountID uint64 `json:"accountID"`
Username string `json:"username"`
Right term.Right `json:"operation"`
Pattern string `json:"pattern"`
}
type CreateGrantResult struct {
GrantID uuid.UUID `json:"grantId"`
GrantID uint64 `json:"grantId"`
}
func (oper *Operator) CreateGrant(ctx context.Context, operatorID uuid.UUID, params *CreateGrantParams) (*CreateGrantResult, error) {
func (oper *Operator) CreateGrant(ctx context.Context, operatorID uint64, params *CreateGrantParams) (*CreateGrantResult, error) {
var err error
res := &CreateGrantResult{}
@@ -100,12 +100,12 @@ func (oper *Operator) CreateGrant(ctx context.Context, operatorID uuid.UUID, par
// UpdateGrant
type UpdateGrantParams struct {
GrantID uuid.UUID
GrantID uint64
NewPattern string
}
type UpdateGrantResult struct{}
func (oper *Operator) UpdateGrant(ctx context.Context, operatorID uuid.UUID, params *UpdateGrantParams) (*UpdateGrantResult, error) {
func (oper *Operator) UpdateGrant(ctx context.Context, operatorID uint64, params *UpdateGrantParams) (*UpdateGrantResult, error) {
var err error
res := &UpdateGrantResult{}
@@ -143,11 +143,11 @@ func (oper *Operator) UpdateGrant(ctx context.Context, operatorID uuid.UUID, par
// DeleteGrant
type DeleteGrantParams struct {
GrantID uuid.UUID `json:"grantId"`
GrantID uint64 `json:"grantId"`
}
type DeleteGrantResult struct{}
func (oper *Operator) DeleteGrant(ctx context.Context, operatorID uuid.UUID, params *DeleteGrantParams) (*DeleteGrantResult, error) {
func (oper *Operator) DeleteGrant(ctx context.Context, operatorID uint64, params *DeleteGrantParams) (*DeleteGrantResult, error) {
var err error
res := &DeleteGrantResult{}
@@ -177,13 +177,13 @@ func (oper *Operator) DeleteGrant(ctx context.Context, operatorID uuid.UUID, par
// ListGrants
type ListGrantsParams struct {
Username string
AccountID uuid.UUID
AccountID uint64
}
type ListGrantsResult struct {
Grants []descr.Grant `json:"grants"`
}
func (oper *Operator) ListGrants(ctx context.Context, operatorID uuid.UUID, params *ListGrantsParams) (*ListGrantsResult, error) {
func (oper *Operator) ListGrants(ctx context.Context, operatorID uint64, params *ListGrantsParams) (*ListGrantsResult, error) {
var err error
res := &ListGrantsResult{
Grants: make([]descr.Grant, 0),
@@ -224,13 +224,13 @@ func (oper *Operator) ListGrants(ctx context.Context, operatorID uuid.UUID, para
// Get Grants
type GetGrantParams struct {
GrantID uuid.UUID `json:"grantId"`
GrantID uint64 `json:"grantId"`
}
type GetGrantResult struct {
Grant *descr.Grant `json:"grant"`
}
func (oper *Operator) GetGrant(ctx context.Context, operatorID uuid.UUID, params *GetGrantParams) (*GetGrantResult, error) {
func (oper *Operator) GetGrant(ctx context.Context, operatorID uint64, params *GetGrantParams) (*GetGrantResult, error) {
var err error
res := &GetGrantResult{}