I'm doing a web app where I have to login as an LDAP user (which works fine until now), but the thing is that for every user, I need some roles that aren't in LDAP but in my Database. I'm working with J2EE 7, Glassfish, and MySQL.

Anyone knows how to do this?


Example of the table user:

| uid | first name | last name | role |
| lceledon | Luis | Celedon | admin|

So I need that lceledon have the admin role and specific authorizations to some views. And yes, the user (uid) that are in the table are known, and also their roles. Anyone who is not in the table has the role "student"