sync.go 349 B

1234567891011121314151617
  1. package permlib
  2. import (
  3. "context"
  4. "fmt"
  5. "github.com/xiaozi/permlib/pb"
  6. )
  7. func (e *Engine) syncPerms(ctx context.Context, perms []*pb.PermItem) error {
  8. resp, err := e.client.syncPermissions(ctx, e.cfg.AppKey, e.cfg.AppSecret, perms)
  9. if err != nil {
  10. return fmt.Errorf("permlib: sync permissions failed: %w", err)
  11. }
  12. _ = resp
  13. return nil
  14. }