From 9e532d2a7290bc2ea9e2dec821b70f68beb8fe77 Mon Sep 17 00:00:00 2001 From: Darko Draskovic Date: Wed, 24 Feb 2021 13:23:50 +0100 Subject: [PATCH] Fix grpc endpoint parameter permutation (#1370) Signed-off-by: Darko Draskovic --- things/api/auth/grpc/endpoint.go | 2 +- things/api/metrics.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/things/api/auth/grpc/endpoint.go b/things/api/auth/grpc/endpoint.go index c389ea69..ff081de0 100644 --- a/things/api/auth/grpc/endpoint.go +++ b/things/api/auth/grpc/endpoint.go @@ -44,7 +44,7 @@ func isChannelOwnerEndpoint(svc things.Service) endpoint.Endpoint { return nil, err } - err := svc.IsChannelOwner(ctx, req.chanID, req.owner) + err := svc.IsChannelOwner(ctx, req.owner, req.chanID) return emptyRes{err: err}, err } } diff --git a/things/api/metrics.go b/things/api/metrics.go index 5568595e..69b89a97 100644 --- a/things/api/metrics.go +++ b/things/api/metrics.go @@ -190,7 +190,7 @@ func (ms *metricsMiddleware) IsChannelOwner(ctx context.Context, owner, chanID s ms.latency.With("method", "is_channel_owner").Observe(time.Since(begin).Seconds()) }(time.Now()) - return ms.svc.CanAccessByID(ctx, owner, chanID) + return ms.svc.IsChannelOwner(ctx, owner, chanID) } func (ms *metricsMiddleware) Identify(ctx context.Context, key string) (string, error) {