Here’s my problem: I’m working on an application where the users have certain rights. Depending on these rights, they would have access to some functions.
My problem is that I would have to test for every case if the user has the rights
or not and enable it or not. For a big app, this task is quite tiring. I want to ask if there is a design pattern or library that simplifies the management of this. My goal is to disable buttons when the user does not have proper permissions.
Multiple things needs to be considered for such a solution
In an idea scenario, I will have following way of dealing with this problem.
I will have user belonging to USergroup and Roles assigned to each
Usergroup in some database.
When the user logins to the application, you can fetch the
usergroup and associated user roles from the database.
has access.
enable/disable fields & buttons.
and then passing the map object to such tags which will validate the
map and accordingly show the field or hide it.
Just want to keep it short and simple.