I came across an interesting problem when implementing a specific role on a website.
Something like this, if the registered user has privileges for the administrator role, then the button (called Transfer) will be enabled , and for the other user it should be disabled (Thus, they cannot click, therefore, they cannot complete the transaction / or call the appropriate logic for this)
At first glance, it seems pretty straightforward UI checking some things. We just need to enable the button if the registered user has administrator privileges.
So, after implementing this approach (works great), I debugged the code using the Chrome developer tools. I noticed that although the button is now disabled, we can actually enable it by deleting the disabled part with the tool.
Just try with this simple violin
And then I can click on it and the functions will be called. In principle, this was not a very good approach. But, fortunately, there is also a validation of the parties to the service. But if this cannot be a huge security vulnerability.
So basically doing a server / service / back-end check will prevent something dangerous. But since a person can actually click on it, and at least he can try to call methods that seem not to be nice :(
So, I would really like to know how we can prevent such situations.
ok, here my question is simple:
Is it good to have components disabled at all?