Esempio n. 1
0
        public override void AddApiServices(IServiceCollection services, Type type)
        {
            var permission = ApiPermission.CreateDeny(
                this.PermissionType,
                this.To,
                this.OnNamespace,
                this.On,
                this.OnChild);

            services.AddInstance(permission);
        }
Esempio n. 2
0
        /// <summary>
        /// Configures an API configuration.
        /// </summary>
        /// <param name="configuration">
        /// An API configuration.
        /// </param>
        /// <param name="type">
        /// The API type on which this attribute was placed.
        /// </param>
        public override void Configure(
            ApiConfiguration configuration,
            Type type)
        {
            var permission = ApiPermission.CreateDeny(
                this.PermissionType,
                this.To,
                this.OnNamespace,
                this.On,
                this.OnChild);

            configuration.AddPermission(permission);
        }