public DataRow InsertNewUserRoleForUser (User UserToProcess, UserRole UserRoleToAdd) { DataRow NewRow = SystemSecurityDataSet.Tables ["webpages_UsersInRoles"].NewRow(); NewRow ["ID"] = System.Guid.NewGuid(); NewRow ["UserID"] = UserToProcess.UserID; NewRow ["RoleID"] = UserRoleToAdd.RoleID; SystemSecurityDataSet.Tables ["webpages_UsersInRoles"].Rows.Add(NewRow); UpdateSystemSecurityDataSet(); return NewRow; }
public void RemoveRoleFromUser (User UserToProcess, UserRole UserRoleToRemoveFromUser) { if (!(UserToProcess.RolesForThisUser.Contains(UserRoleToRemoveFromUser))) return; SecuringDirectoryDataWrapper.Instance.RemoveUserRoleFromUser(UserToProcess.UserID, UserRoleToRemoveFromUser.RoleID); }
public void ChangeUserRoleColor (UserRole UserRoleToChangeColor, String NewColor) { UserRoleToChangeColor.BrushName = NewColor; SecuringDirectoryDataWrapper.Instance.UpdateSystemSecurityDataSet(); }
public void AddNewRoleToUser (User UserToProcess, UserRole UserRoleToAdd) { if (UserToProcess.RolesForThisUser.Contains(UserRoleToAdd)) return; DataRow UserInRoleRow = SecuringDirectoryDataWrapper.Instance.InsertNewUserRoleForUser (UserToProcess, UserRoleToAdd); UserToProcess.RolesForThisUser.Add(UserRoleToAdd); UsersInRoles.Add( new UserInRole(this, UserInRoleRow)); }
public void DeleteUserRole (UserRole EntryToDelete) { int RoleID = EntryToDelete.RoleID; foreach (UserInRole UserInRoleEntry in UsersInRoles) { if (UserInRoleEntry.RoleID == RoleID) UserInRoleEntry.BasisRow.Delete(); } SecuringDirectoryDataWrapper.Instance.UpdateSystemSecurityDataSet(); foreach (User UserEntry in Users) { UserEntry.RolesForThisUser.Remove(EntryToDelete); } EntryToDelete.BasisRow.Delete(); SecuringDirectoryDataWrapper.Instance.UpdateSystemSecurityDataSet(); }