Пример #1
0
        /// <summary>
        /// Overloads the SiteMapNode->IsAccessibleToUser method to test if the given User can access a particular page.
        /// </summary>
        public static bool IsAccessibleToUser(this SiteMapNode node, IUser user)
        {
            var userRoles = user.GetRoles().ToHashSet();

            var inRole = node.InheritedRoles().Any(userRoles.Contains);

            return(inRole);
        }