Пример #1
0
        public void TestOfAdminUpdateRole()
        {
            base.InitAdmins();
            var mainApp  = this.CreateDefaultApp();
            var testRole = NewObject <SCRole>("测试角色");

            this.CreateRole(mainApp, testRole);

            FacadeWithAcl.UpdateRole(testRole);
        }
Пример #2
0
        public void TestOfIllegalUpdateRole()
        {
            base.InitAdmins();

            var mainApp = this.CreateDefaultApp();

            var testRole = NewObject <SCRole>("测试角色");

            this.CreateRole(mainApp, testRole);

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

            FacadeWithAcl.UpdateRole(testRole);
            Assert.Fail("不应该执行到此");
        }
Пример #3
0
        public void TestOfUpdateRole()
        {
            base.InitAdmins();

            var mainApp  = this.CreateDefaultApp();
            var mainRole = this.CreateDefaultRoleWithMembers(this.GetSCUsersByCodeNames("wanglch"));

            this.SetContainerMemberAndPermissions(mainApp, mainRole, new string[] { "UpdateRoles" });

            var testRole = NewObject <SCRole>("测试角色");

            this.CreateRole(mainApp, testRole);

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

            FacadeWithAcl.UpdateRole(testRole);
        }