public void TestOfAdminUpdateRole() { base.InitAdmins(); var mainApp = this.CreateDefaultApp(); var testRole = NewObject <SCRole>("测试角色"); this.CreateRole(mainApp, testRole); FacadeWithAcl.UpdateRole(testRole); }
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("不应该执行到此"); }
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); }