BEIRUT, Lebanon — Lebanon passed a law on Tuesday granting Palestinian refugees here the same rights to work as other foreigners, a step in ending years of discrimination that had restricted them to the most menial of jobs.