コード例 #1
0
 protected void LoginUser(UserInformation userInformation)
 {
     // Create and attach a claims based principal to the current thread
     Thread.CurrentPrincipal = userInformation.ToClaimsPrincipal();
 }
コード例 #2
0
 protected void LoginUser(string userName, string[] roleNames, UserInformation userInformation)
 {
     // Create and attach a claims based principal to the current thread
     Thread.CurrentPrincipal = userInformation.ToClaimsPrincipal(userName, roleNames);
 }
コード例 #3
0
 protected void LoginUser(UserInformation userInformation)
 {
     Thread.CurrentPrincipal = userInformation.ToClaimsPrincipal();
 }
コード例 #4
0
        protected override void EstablishContext()
        {
            base.EstablishContext();

            staffStudentAssociationRepository = mocks.StrictMock<IRepository<StaffStudentAssociation>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            currentUserClaimInterrogator = mocks.StrictMock<ICurrentUserClaimInterrogator>();
            windsorContainer = new WindsorContainer();
            RegisterProviders(windsorContainer);

            userEntryProvider = windsorContainer.Resolve<IUserEntryProvider>();

            var suppliedUserInformation = new UserInformation
                                                {
                                                    StaffUSI = suppliedStaffUSI,
                                                    AssociatedOrganizations = new List<UserInformation.EducationOrganization>()
                                                                                {
                                                                                    new UserInformation.School(suppliedLocalEducationAgencyId, suppliedSchoolId)
                                                                                        {
                                                                                            ClaimTypes = new List<string>
                                                                                                                {
                                                                                                                    EdFiClaimTypes.ViewAllTeachers
                                                                                                                }
                                                                                        }
                                                                                }
                                                };
            Thread.CurrentPrincipal = suppliedUserInformation.ToClaimsPrincipal();
        }