I have a database which contains users, roles, and permissions. I want to be able to map this to the front end (Java Swing) so a user who can't do an action can't see it.
An example:
- Role AddressManager has permissions create_address, edit_address and remove_address.
- User A has permissions create_address and edit_address.
- User B has permission remove_address.
I want three buttons for the address view that represent the roles from the AddressManager, and for the users A and B to enable / disable the buttons.
Question: Is there any easy way to map database table values to Swing components (Buttons)?
One way is to assign enable/disable manually to every single component, but that’s unpractical if there are 40 dialogs in the application with about 200 components that must have permission.