Microsoft.AspNet.SignalR.AuthorizeAttribute.AuthorizeHubConnection C# (CSharp) Метод

AuthorizeHubConnection() публичный Метод

Determines whether client is authorized to connect to IHub.
public AuthorizeHubConnection ( HubDescriptor hubDescriptor, IRequest request ) : bool
hubDescriptor Microsoft.AspNet.SignalR.Hubs.HubDescriptor Description of the hub client is attempting to connect to.
request IRequest The (re)connect request from the client.
Результат bool
        public virtual bool AuthorizeHubConnection(HubDescriptor hubDescriptor, IRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            // If RequireOutgoing is explicitly set to false, authorize all connections.
            if (_requireOutgoing.HasValue && !_requireOutgoing.Value)
            {
                return true;
            }

            return UserAuthorized(request.User);
        }