Ejemplo n.º 1
0
 public AccountController(AuthIdentityService perms, DataStoreFactory factory)
     : base(perms, factory)
 {
 }
Ejemplo n.º 2
0
 public OrganizationsController(AuthIdentityService perms, DataStoreFactory factory)
     : base(perms, factory)
 {
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
 public MembersController(AuthIdentityService perms, DataStoreFactory store)
     : base(perms, store)
 {
 }
Ejemplo n.º 6
0
 public ControllerBase(AuthIdentityService permissions, DataStoreFactory storeFactory)
 {
     this.Permissions = permissions;
     this.StoreFactory = storeFactory;
 }