All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
You are not entitled to receive pay for the days that you were absent from work without permission from the concerned authority at work. If you received pay for those days, then you are obliged to pay it back to the concerned authority unless you inform them of what you did and they gave you permission to retain that pay.
If you informed the concerned authority at work of your absence on those days and they approved to give you your full salary with no deduction, then there is no harm in this case and you bear no sin for taking the salary in full and availing yourself of it.
As to what some employees do to evade a salary deduction by not reporting their absence or using fake excuses or forging medical leaves and the like, all this is unlawful and makes the pay for the days of absence unlawful for them since what they constitutes lying and deception. Allaah, The Exalted, says (what means): {...and avoid false statements...} [Quran 22:30] The Prophet, sallallaahu ʻalayhi wa sallam, said, “Should I inform you about the gravest major sins?” and he repeated the question three times. We (the Companions) said, “Yes, O Messenger of Allaah.” He said, “Associating partners with Allaah, disobedience to parents,” and he was reclining, so he sat up straight and said, “and beware of false testimony,” and he kept repeating it until we wished that he would stop. [Al-Bukhari and Muslim]
Allaah knows best.