Пример #1
0
        /// <summary>
        /// Define a user actor for a <see cref="ISecurable">securable</see>
        /// </summary>
        /// <param name="securable"><see cref="ISecurable"/> to secure</param>
        /// <param name="principalResolver">Resolves the <see cref="IPrincipal" /></param>
        /// <returns>The <see cref="ISecurable"/> chain</returns>
        public static UserSecurityActor UserFrom(this ISecurable securable, ICanResolvePrincipal principalResolver)
        {
            var actor = new UserSecurityActor(principalResolver);

            securable.AddActor(actor);
            return(actor);
        }
Пример #2
0
        /// <summary>
        /// Define a user actor for a <see cref="ISecurable">securable</see>
        /// </summary>
        /// <param name="securable"><see cref="ISecurable"/> to secure</param>
        /// <returns>The <see cref="UserSecurityActor"/></returns>
        public static UserSecurityActor User(this ISecurable securable)
        {
            var actor = new UserSecurityActor(Configure.Instance.Container.Get <ICanResolvePrincipal>());

            securable.AddActor(actor);
            return(actor);
        }
Пример #3
0
        /// <summary>
        /// Define a user actor for a <see cref="ISecurable">securable</see>
        /// </summary>
        /// <param name="securable"><see cref="ISecurable"/> to secure</param>
        /// <returns>The <see cref="UserSecurityActor"/></returns>
        public static UserSecurityActor User(this ISecurable securable)
        {
            var actor = new UserSecurityActor();

            securable.AddActor(actor);
            return(actor);
        }