I am a Muslim living in Sweden, and I have a friend who works in a maintenance workshop. In that workshop there is an engineer who claims to be a Muslim but he reviles Allah, may He be glorified and exalted and reviles the Messenger (blessings and peace of Allah be upon him) in the most horrible terms. I asked my colleague to leave that job, out of love for Allah and His Messenger, and for the religion of Allah, but he argued that this engineer is only an employee and has nothing to do with the job. We went to the owner of the workplace and, as he is a Muslim, we told him about it, but he said that this engineer is important and they cannot do without him or find an alternative. What is the ruling on my friend working in this place, especially since we are a group who live in one place and my friend lives with us? What is the correct way to stand up for Allah and his Messenger (blessings and peace of Allah be upon him), in the light of the Qur’an and Sunnah and the understanding of the righteous early generations? Please advise us, may Allah reward you.

Praise
be to Allah.

Firstly: 

What the Muslim must do is avoid being present in any
gathering in which Allah is being disobeyed, so how about a gathering in
which Allah and His Messenger are being reviled? 

Allah, may He be glorified and exalted, says (interpretation
of the meaning):


“And when you (Muhammad (blessings and peace of Allah be upon
him)) see those who engage in a false conversation about Our Verses (of the
Quran) by mocking at them, stay away from them till they turn to another
topic. And if Shaitan (Satan) causes you to forget, then after the
remembrance sit not you in the company of those people who are the Zalimoon
(polytheists and wrongdoers, etc.)”


[al-An‘aam 6:68]

If anyone finds himself in a gathering in which people cast
aspersions on the verses of Allah, or mock them, or show disrespect towards
them, or revile them, then he must leave their gathering until they begin to
speak of something other than the falsehood in which they were indulging. 

Allah, may He be glorified and exalted, says (interpretation
of the meaning):


“And it has already been revealed to you in the Book (this
Quran) that when you hear the Verses of Allah being denied and mocked at,
then sit not with them, until they engage in a talk other than that; (but if
you stayed with them) certainly in that case you would be like them. Surely,
Allah will collect the hypocrites and disbelievers all together in Hell”


[an-Nisa’ 4:140]

Al-Qurtubi said:

Anyone who sits in a sinful gathering and does not object to
them will bear an equal burden of sin with them. They should be denounced if
they speak sinful words or do sinful actions. If he is not able to denounce
them, then he should get up and leave so that he will not be one of those
included in this verse.

End quote from al-Jaami‘ li Ahkaam al-Qur’an (5/418) 

Based on that, what you must do is denounce this evildoer; if
you are not able to do that then you must leave this gathering. If that is
not possible, then in that case you must stop working in this place, so long
as you can hear someone reviling Allah and His Messenger and you are not
able to denounce it or leave that gathering. 

Shaykh ‘Abd ar-Rahmaan as-Sa‘di said: This prohibition
applies to the one who sits with them and does not feel the fear of Allah
when he joins them in haraam words deeds or keeps quiet and not denounce
them. If he does fear Allah, may He be exalted, by telling them to do what
is good and forbids them to do evil or to say these words that they are
uttering, and that results in removal or reduction of the evil, then there
will be no blame or sin on him.

End quote from Tayseer al-Kareem ar-Rahmaan (1/260) 

See also the answer to question no. 65551

Secondly: 

The best way to stand up for Allah and His Messenger in this
situation is by doing several things:

 1.

Denouncing him for what he says and being harsh towards him
in that regard; explaining the seriousness of what he is saying and the
stern warning against reviling Allah and His Messenger; and advising the
people around him not to listen to him because of the seriousness of what he
is saying. 

The one who reviles Allah and His Messenger is an apostate
from the religion of Islam; all his good deeds are rendered invalid, his
marriage contract is annulled and his Muslim wife becomes haraam to him. If
he dies in that state without having repented, then he is not to be washed
or shrouded, the funeral prayer is not to be offered for him, and he is not
to be buried in the Muslim graveyard. Similarly, he cannot inherit or be
inherited from, and his fate in the Hereafter is to abide forever and
eternally in the fire of Hell. 

See the answer to questions no. 22809,
114779 and 14305

2.

Ongoing shunning and severing of ties with him, if he does
not repent from the disbelief and misguidance that he is following, as
Allah, may He be exalted, says concerning Ibraaheem (peace be upon him):


“Indeed there has been an excellent example for you in
Ibrahim (Abraham) and those with him, when they said to their people:
“Verily, we are free from you and whatever you worship besides Allah, we
have rejected you, and there has started between us and you, hostility and
hatred for ever, until you believe in Allah Alone…”


[al-Mumtahinah 60:4]

Shaykh ‘Abd ar-Rahmaan al-Barraak said:

The least that must be done, in addition to denouncing him
verbally and highlighting the fact that this is apostasy, is to cut off ties
with him and not sit with him. If a person is faced with having to deal with
him in the workplace, then he must shun him and turn away from him; so he
should not greet him or interact with him in any friendly manner, and he
should not speak to him any word that is indicative of lenience, so that he
will feel the true nature of his crime and the abhorrent nature of what he
has been saying.

End quote from Majmoo‘ Fataawa al-‘Allaamah al-Barraak
(1/8) 

You have to advise the boss that if he is a Muslim and truly
loves Allah and His Messenger, then he must be angry for their sake and
stand up for them. The least he should do is to advise this evildoer, and if
he does not refrain from his disbelief then the least that he can do is to
dismiss him from his job; he cannot let love of work and worldly gain take
precedence over love of Allah and His Messenger. Allah, may He be exalted,
says (interpretation of the meaning):


“Say: If your fathers, your sons, your brothers, your wives,
your kindred, the wealth that you have gained, the commerce in which you
fear a decline, and the dwellings in which you delight are dearer to you
than Allah and His Messenger, and striving hard and fighting in His Cause,
then wait until Allah brings about His Decision (torment). And Allah guides
not the people who are Al-Fasiqoon (the rebellious, disobedient to Allah)”


[at-Tawbah 9:24]

Whoever gives up something for the sake of Allah, Allah will
compensate him with something better than it. So it is certain that if the
boss dismisses this evildoer from his job, Allah, may He be exalted, will
compensate him with something better than him, and his business will not
incur loss because of that. 

And Allah knows best.