c# Programming Glossary: iidentity
How to manipulate WPF GUI based on user roles http://stackoverflow.com/questions/1019204/how-to-manipulate-wpf-gui-based-on-user-roles manipulate WPF GUI based on user roles I am using .NET's IIdentity and IPrincipal objects for role based security and I am at the.. fields in a WPF window showing hiding fields dependent on IIdentity.IsInRole type calls. Can this be done in XAML or do I have to..
How does Request.IsAuthenticated work? http://stackoverflow.com/questions/2201238/how-does-request-isauthenticated-work the GenericIdentity in Context.User.Identity with a new IIdentity object that will return true from its IsAuthenticated property...
.NET built-in helper to parse Domain\Username in User.Identity.Name http://stackoverflow.com/questions/349520/net-built-in-helper-to-parse-domain-username-in-user-identity-name class Extensions public static string GetDomain this IIdentity identity string s identity.Name int stop s.IndexOf return.. 0 stop string.Empty public static string GetLogin this IIdentity identity string s identity.Name int stop s.IndexOf return.. 1 s.Substring stop 1 s.Length stop 1 string.Empty Usage IIdentity id HttpContext.Current.User.Identity id.GetLogin id.GetDomain..
Mock HttpContext.Current in Test Init Method http://stackoverflow.com/questions/4379450/mock-httpcontext-current-in-test-init-method just enough for you do replace the IPrincipal User and IIdentity . The following code runs as expected even in a console application..
Is this Custom Principal in Base Controller ASP.NET MVC 3 terribly inefficient? http://stackoverflow.com/questions/8263845/is-this-custom-principal-in-base-controller-asp-net-mvc-3-terribly-inefficient public class MyPrincipal IPrincipal public MyPrincipal IIdentity ident List string roles string email Guid userId this._identity.. this._roles roles this._email email this._userId userId IIdentity _identity public IIdentity Identity get return _identity private.. email this._userId userId IIdentity _identity public IIdentity Identity get return _identity private List string _roles public..
Setting the httpcontext current session in unit test http://stackoverflow.com/questions/9624242/setting-the-httpcontext-current-session-in-unit-test var user new Mock IPrincipal var identity new Mock IIdentity var urlHelper new Mock UrlHelper var routes new RouteCollection..
|