public bool AuthorizeHubConnection(HubDescriptor hubDescriptor, IRequest request)
 {
     VerifyArgument.IsNotNull("hubDescriptor", hubDescriptor);
     VerifyArgument.IsNotNull("request", request);
     var result = request.User.IsAuthenticated() && Service.IsAuthorized(hubDescriptor.GetAuthorizationRequest(request));
     return result;
 }
        public bool AuthorizeHubConnection(HubDescriptor hubDescriptor, IRequest request)
        {
            VerifyArgument.IsNotNull("hubDescriptor", hubDescriptor);
            VerifyArgument.IsNotNull("request", request);
            var result = request.User.IsAuthenticated() && Service.IsAuthorized(hubDescriptor.GetAuthorizationRequest(request));

            // ReSharper disable ConditionIsAlwaysTrueOrFalse
            if(request.User.Identity != null)
            // ReSharper restore ConditionIsAlwaysTrueOrFalse
            {
                Dev2Logger.Log.Debug("AuthorizeHubConnection For [ " + request.User.Identity.Name + " ]");
            }

            return result;
        }