简体   繁体   English

IdentityManager接缝问题

[英]IdentityManager seam problem

I have a problem with IdentityManager and seam. 我对IdentityManager和接缝有问题。 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. 在研究了问题之后,似乎identityManager尚未从数据库加载权限。

So my question is: 所以我的问题是:

How to refresh identityManager to force it to refresh data ? 如何刷新identityManager以强制其刷新数据?

Thanks. 谢谢。

You need to refresh the roles of the identity manually. 您需要手动刷新身份的角色。 You should check out this post 你应该看看这个帖子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM