working commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user