public void RoleMatrixUsersTest() { IRole role = GetTestRole(); SOARole soaRole = SOARoleHelper.PrepareSOARole(role); SOARolePropertyRowUsersCollection rowsUsers = soaRole.Rows.GenerateRowsUsers(); //输出每一行中的每一个人,也包括指定的列 Output(rowsUsers); }
public void OperatorBelongToRoleMatrixTest() { IRole role = GetTestRole(); SOARole soaRole = SOARoleHelper.PrepareSOARole(role); IUser user = OguMechanismFactory.GetMechanism().GetObjects <IUser>(SearchOUIDType.LogOnName, "fanhy").First(); List <string> roleIDs = SOARolePropertiesAdapter.Instance.OperatorBelongToRoleIDsDirectly(user.ID); foreach (string roleID in roleIDs) { SOARolePropertyRowCollection rows = SOARolePropertiesAdapter.Instance.GetByRoleID(roleID); Output(rows); } }