コード例 #1
0
 public static ModuleCatalog AddFrameworkModules(this ModuleCatalog moduleCatalog)
 {
     return moduleCatalog
         .AddModule(typeof (RibbonModule))
         .AddModule(typeof (NotificationsModule))
         .AddModule(typeof (ExplorerModule), dependsOn: "TranslationModule")
         ;
 }
コード例 #2
0
        /// <summary>
        /// By default, clients that are reconnecting to the server will be removed from all groups they may have previously been a member of.
        /// Enabling AutoRejoiningGroups allows all clients to rejoin the all of the hub groups the claim to be a member of automatically
        /// on connect and reconnect.
        /// Enabling this module may be insecure because untrusted clients may claim to be a member of groups they were never authorized to join.
        /// </summary>
        /// <param name="pipeline">The <see cref="IHubPipeline" /> to which the <see cref="AutoRejoiningGroupsModule" /> will be added.</param>
        public static void EnableAutoRejoiningGroups(this IHubPipeline pipeline)
        {
            if (pipeline == null)
            {
                throw new ArgumentNullException("pipeline");
            }

            pipeline.AddModule(new AutoRejoiningGroupsModule());
        }
コード例 #3
0
        /// <summary>
        /// Requiring Authentication adds an <see cref="AuthorizeModule"/> to the <see cref="IHubPipeline" /> with <see cref="IAuthorizeHubConnection"/>
        /// and <see cref="IAuthorizeHubMethodInvocation"/> authorizers that will be applied globally to all hubs and hub methods.
        /// These authorizers require that the <see cref="System.Security.Principal.IPrincipal"/>'s <see cref="System.Security.Principal.IIdentity"/> 
        /// IsAuthenticated for any clients that invoke server-side hub methods or receive client-side hub method invocations. 
        /// </summary>
        /// <param name="pipeline">The <see cref="IHubPipeline" /> to which the <see cref="AuthorizeModule" /> will be added.</param>
        public static void RequireAuthentication(this IHubPipeline pipeline)
        {
            if (pipeline == null)
            {
                throw new ArgumentNullException("pipeline");
            }

            var authorizer = new AuthorizeAttribute();
            pipeline.AddModule(new AuthorizeModule(globalConnectionAuthorizer: authorizer, globalInvocationAuthorizer: authorizer));
        }
コード例 #4
0
ファイル: HubPipelineExtensions.cs プロジェクト: neiz/SignalR
 public static void EnableAutoRejoiningGroups(this IHubPipeline pipeline)
 {
     pipeline.AddModule(new AutoRejoiningGroupsModule());
 }
コード例 #5
0
 public static void RequireAuthentication(this IHubPipeline pipeline)
 {
     var authorizer = new AuthorizeAttribute();
     pipeline.AddModule(new AuthorizeModule(globalConnectionAuthorizer: authorizer, globalInvocationAuthorizer: authorizer));
 }
コード例 #6
0
 public static DiscordClient UsingDynamicPerms(this DiscordClient client)
 {
     client.AddService(new DynamicPermissionService());
     client.AddModule<DynamicPermissionModule>("Dynamic Permissions");
     return client;
 }
コード例 #7
0
 public static ModuleCatalog AddFrameworkExtensionModules(this ModuleCatalog moduleCatalog)
 {
     return moduleCatalog
         .AddModule(typeof(TranslationModule));
 }
コード例 #8
0
 public static ModuleCatalog AddClientModules(this ModuleCatalog moduleCatalog)
 {
     return moduleCatalog
         .AddModule(typeof(ClientResourcesModule))
         .AddModule(typeof(PersonModule));
 }