Click here to Skip to main content
15,883,813 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Team,
I have button on the ASP.net website and that button will be getting enabled based on the user role. For the use who does not have permission are able to enable the button using Developer Tool (F12). Do we have any option or feature to handle this situation?

Note: I know that in server side we can have check to validate user rights. But i want know solution without server side.

Thanks in advance.

What I have tried:

I have tried to disable right click and other option and those are did not work properly.
Posted
Updated 5-May-20 0:13am
Comments
phil.o 5-May-20 5:17am    
Whatever you will do, client side code will always be vulnerable to alteration by the client. The only place where you should handle what is possible and what is not based on user rights is on the server side.
DerekT-P 5-May-20 7:51am    
If someone's going to try this, they probably have the skill and motivation to do it just by crafting a POST request using a proxy anyway, so as per the suggested solution, you MUST check permissions server side. However, by sending a disabled button, you are (a) giving people ideas and (b) telling them the name of the button. With or without "enabling" the button, I can create a POST using that button name and you've no idea if it was enabled or not. However without the button name, I can only guess at what it might be. If it's sensitive and if verifying permissions on the server is "expensive" then just don't send the (disabled) button at all, to remove temptation; and name it something obscure (or even give it a dynamic, random name) then any hacker won't know what to press. BUT you still need to verify permissions at server side!! :-)

1 solution

There is no client side solution. You always need to confirm server side that the person has the rights to do what they are doing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900