Files
gmbase/app/handler/grant.go
T
2026-06-05 18:25:03 +02:00

32 lines
791 B
Go

package handler
import (
"context"
"mbase/pkg/mbctl"
)
func (hand *Handler) SetGrant(ctx context.Context, params *mbctl.SetGrantParams) (*mbctl.SetGrantResult, error) {
var err error
hand.log.Debugf("Handle SetGrant call")
res := &mbctl.SetGrantResult{}
accountID, err := hand.Authentificate(ctx)
if err != nil {
return res, err
}
res, err = hand.lg.SetGrant(ctx, accountID, params)
return res, err
}
func (hand *Handler) DeleteGrant(ctx context.Context, params *mbctl.DeleteGrantParams) (*mbctl.DeleteGrantResult, error) {
var err error
hand.log.Debugf("Handle DeleteGrant call")
res := &mbctl.DeleteGrantResult{}
accountID, err := hand.Authentificate(ctx)
if err != nil {
return res, err
}
res, err = hand.lg.DeleteGrant(ctx, accountID, params)
return res, err
}