コード例 #1
0
 public AccountController(AuthIdentityService perms, DataStoreFactory factory)
     : base(perms, factory)
 {
 }
コード例 #2
0
 public OrganizationsController(AuthIdentityService perms, DataStoreFactory factory)
     : base(perms, factory)
 {
 }
コード例 #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);
        }
コード例 #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();
        }
コード例 #5
0
 public MembersController(AuthIdentityService perms, DataStoreFactory store)
     : base(perms, store)
 {
 }
コード例 #6
0
ファイル: ControllerBase.cs プロジェクト: sartracks/SARTracks
 public ControllerBase(AuthIdentityService permissions, DataStoreFactory storeFactory)
 {
     this.Permissions = permissions;
     this.StoreFactory = storeFactory;
 }