public a_type_securable()
        {
            action_of_secured_type = new SomeType();
            action_of_another_type = new DifferentNamespace.TypeInDifferentNamespace();

            type_securable = new TypeSecurable(action_of_secured_type.GetType());
        }
        public a_type_securable()
        {
            action_of_secured_type = new SimpleCommand();
            action_of_another_type = new CommandInADifferentNamespace();

            type_securable = new TypeSecurable(action_of_secured_type.GetType());
        }
Beispiel #3
0
        /// <summary>
        /// Add a <see cref="TypeSecurable"/> to the <see cref="ServiceSecurityTarget"/> for a given type
        /// </summary>
        /// <param name="target"><see cref="ServiceSecurityTarget"/> to add to</param>
        /// <param name="continueWith">Callback for continuing the fluent interface</param>
        /// <returns><see cref="TypeSecurable"/> for the specific type</returns>
        public static ServiceSecurityTarget InstanceOf <T>(this ServiceSecurityTarget target, Action <TypeSecurable> continueWith)
        {
            var securable = new TypeSecurable(typeof(T));

            target.AddSecurable(securable);
            continueWith(securable);
            return(target);
        }
Beispiel #4
0
        /// <summary>
        /// Add a <see cref="TypeSecurable"/> to the <see cref="CommandSecurityTarget"/> for a given type
        /// </summary>
        /// <typeparam name="T">Type of <see cref="ICommand"/> to secure</typeparam>
        /// <param name="target"><see cref="CommandSecurityTarget"/> to add to</param>
        /// <param name="continueWith">Callback for continuing the fluent interface</param>
        /// <returns><see cref="TypeSecurable"/> for the specific type</returns>
        public static CommandSecurityTarget InstanceOf <T>(this CommandSecurityTarget target, Action <TypeSecurable> continueWith) where T : ICommand
        {
            var securable = new TypeSecurable(typeof(T));

            target.AddSecurable(securable);
            continueWith(securable);
            return(target);
        }