From d758fef361521c6d8e77968c50a76ae57985614b Mon Sep 17 00:00:00 2001 From: DanB Date: Sun, 3 Feb 2019 12:36:07 +0100 Subject: [PATCH] DispatcherS.AttributeSv1GetAttributeForEvent with auth implementation --- dispatchers/attributes.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dispatchers/attributes.go b/dispatchers/attributes.go index 40b295ec1..bf50f3e8a 100755 --- a/dispatchers/attributes.go +++ b/dispatchers/attributes.go @@ -32,10 +32,13 @@ func (dS *DispatcherService) AttributeSv1Ping(ign string, reply *string) error { func (dS *DispatcherService) AttributeSv1GetAttributeForEvent(args *ArgsAttrProcessEventWithApiKey, reply *engine.AttributeProfile) (err error) { - //if err = dS.authorize(utils.AttributeSv1GetAttributeForEvent, args.AttrArgsProcessEvent.CGREvent.Tenant, - // args.APIKey, args.AttrArgsProcessEvent.CGREvent.Time); err != nil { - // return - //} + if dS.attrS != nil { + if err = dS.authorize(utils.AttributeSv1GetAttributeForEvent, + args.AttrArgsProcessEvent.CGREvent.Tenant, + args.APIKey, args.AttrArgsProcessEvent.CGREvent.Time); err != nil { + return + } + } return dS.Dispatch(&args.CGREvent, utils.MetaAttributes, utils.AttributeSv1GetAttributeForEvent, args.AttrArgsProcessEvent, reply)