예제 #1
0
        public void AdminUpdateUserTest()
        {
            this.InitAdmins();

            var mainRole  = this.CreateDefaultRoleWithMembers(this.GetSCUsersByCodeNames("wanglch"));
            var mainOrg   = this.GetOrganizationByCodeName("costEngineer");
            var testOrgA  = NewObject <PC.SCOrganization>("测试组织A");
            var testOrgB  = NewObject <PC.SCOrganization>("测试组织B");
            var testUserA = this.NewObject <PC.SCUser>("测试用户A");


            Facade.AddOrganization(testOrgA, mainOrg);
            Facade.AddOrganization(testOrgB, mainOrg);
            Facade.AddUser(testUserA, testOrgA);
            Facade.AddUserToOrganization(testUserA, testOrgB);

            FacadeWithAcl.UpdateUser(testUserA);
        }
예제 #2
0
        public void LegalUpdateUserTest()
        {
            this.InitAdmins();

            var mainRole  = this.CreateDefaultRoleWithMembers(this.GetSCUsersByCodeNames("wanglch"));
            var mainOrg   = this.GetOrganizationByCodeName("costEngineer");
            var testOrgA  = NewObject <PC.SCOrganization>("测试组织A");
            var testOrgB  = NewObject <PC.SCOrganization>("测试组织B");
            var testUserA = this.NewObject <PC.SCUser>("测试用户A");

            Facade.AddOrganization(testOrgA, mainOrg);
            Facade.AddOrganization(testOrgB, mainOrg);
            Facade.AddUser(testUserA, testOrgA);
            Facade.AddUserToOrganization(testUserA, testOrgB);

            SetContainerMemberAndPermissions(testOrgA, mainRole, new string[] { "UpdateChildren" });

            SetCurrentPrincipal(this.GetUserByCodeName("wanglch"));

            FacadeWithAcl.UpdateUser(testUserA);
        }