views:

66

answers:

1

Hi,

I have a problem with IdentityManager and seam. I explain my problem:

In my application, I have a page to add permission to a role. The method to save it is here:

   JpaPermissionStore jpaPermissionStore = (JpaPermissionStore) Component.getInstance("org.jboss.seam.security.jpaPermissionStore", true);
    List<Permission> permissions = new ArrayList<Permission>();
    for (String s : this.selectedActions)
        permissions.add(new Permission(this.selectedTarget, s, new org.jboss.seam.security.Role(role)));
    if (permissions.size() > 0)
        jpaPermissionStore.grantPermissions(permissions);
    Conversation.instance().end();

All work fine with this method. Permissions are added in database.

But after to have save permission, the application redirect the user in a page which list role with permissions.

In this page, the new permission doesn't appear. After research the problem, it seem the identityManager haven't load permission from database.

So my question is:

How to refresh identityManager to force it to refresh data ?

Thanks.

+1  A: 

You need to refresh the roles of the identity manually. You should check out this post

Osmund