public AccountController(AuthIdentityService perms, DataStoreFactory factory) : base(perms, factory) { }
public OrganizationsController(AuthIdentityService perms, DataStoreFactory factory) : base(perms, factory) { }
public static AuthIdentityService GetInstance(IPrincipal principal, DataStoreFactory factory) { string username = (principal == null) ? "" : principal.Identity.Name; //if (!AuthIdentityServiceCache.cache.ContainsKey(username)) //{ // cache[username] = new AuthIdentityService(username, factory); //} //return cache[username]; return new AuthIdentityService(username, factory); }
public AuthIdentityService(string username, DataStoreFactory storeFactory) { this.storeFactory = storeFactory; using (var ctx = storeFactory.Create(username)) { this.currentUser = ctx.Users.IncludePaths("Member").SingleOrDefault(f => f.Username == username); } this.IsUser = this.currentUser != null; this.UserLogin = username; this.UserName = (this.currentUser == null) ? username : (this.currentUser.Member == null) ? this.currentUser.Name : this.currentUser.Member.FullName; this.IsAuthenticated = !string.IsNullOrWhiteSpace(username); Init(); }
public MembersController(AuthIdentityService perms, DataStoreFactory store) : base(perms, store) { }
public ControllerBase(AuthIdentityService permissions, DataStoreFactory storeFactory) { this.Permissions = permissions; this.StoreFactory = storeFactory; }