views:

56

answers:

0

Hi all,

I am using form based authentication with tomcat.

In a certain point in my site I allow the user to decide whether they want to add a role to their account. i.e. a user can decide to be an administrator as well. This request results in a new database entry. Now, in the site I show or hide certain links depending to what roles the user belongs. Hence, I would like the administrative links to be available to this user right after he/she chooses to be administrator. The problem is that this doesn't happen unless I logout and login again. I suspect that this happens because no matter if the new role is added to the DB, the UserPrincipal is not updated and my code sees the old list of roles only, whereas when I logout and login the new UserPrincipal is fetched and hence the adinistrative links are visible.

Does anyone have in mind any solution to that? Many thanks in advance.