예제 #1
0
 public void AddPubSubPermission(WampPubSubPermissions pubSubPermission)
 {
     if (pubSubPermission.prefix)
     {
         mPubSubPrefixPermissions.Add(pubSubPermission);
     }
     else
     {
         mPubSubPermissions[pubSubPermission.uri] = pubSubPermission;
     }
 }
예제 #2
0
        public void Publish(IWampClient client, string topicUri, TMessage @event)
        {
            string resolvedTopicUri = ResolveUri(client, topicUri);
            WampCraAuthenticator <TMessage> wampAuth = GetOrCreateWampAuthenticatorForClient(client);

            if (wampAuth.IsAuthenticated)
            {
                WampPubSubPermissions pubSubPerm = wampAuth.CraPermissionsMapper.LookupPubSubPermissions(resolvedTopicUri);
                if (pubSubPerm != null && pubSubPerm.pub)
                {
                    mPubSubServer.Publish(client, resolvedTopicUri, @event);
                }
            }
        }