예제 #1
0
		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;
			}
예제 #2
0
	    public void RemoveRoleFromUser (User UserToProcess, UserRole UserRoleToRemoveFromUser)
		    {
			if (!(UserToProcess.RolesForThisUser.Contains(UserRoleToRemoveFromUser)))
				return;
			SecuringDirectoryDataWrapper.Instance.RemoveUserRoleFromUser(UserToProcess.UserID, UserRoleToRemoveFromUser.RoleID);
		    }
예제 #3
0
	    public void ChangeUserRoleColor (UserRole UserRoleToChangeColor, String NewColor)
		    {
		    UserRoleToChangeColor.BrushName = NewColor;
			SecuringDirectoryDataWrapper.Instance.UpdateSystemSecurityDataSet();
			}
예제 #4
0
	    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));
		    }
예제 #5
0
	    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();
		    }