jHipster - 如何添加新的用户角色

时间:2016-04-09 15:42:04

标签: java spring-security jhipster

尝试在JHipster 2.27.2生成的项目中添加新角色(ROLE_MANAGERS)。我可以看到需要更新的表(角色,权限和role_authority映射)。

如何添加新角色?

2 个答案:

答案 0 :(得分:0)

At the moment in JHipster the roles/authorities are not exposed over a restful resource.

So there are 2 options for you to proceed:

  1. you find a file src/main/resources/config/liquibase/authorites.csv and add all the roles you need. They will be generated as soon as liquibase migrates your database

  2. implement some RestController for managing them

答案 1 :(得分:0)

Liquidbase不会自动更新将每个笔记插入JHI_AUTHORITY表所需的角色。

这还不够,因为有些js脚本有你应该更新的硬编码权限列表。

这里有一个很好的链接,它更新了更新权限角色列表的步骤: http://techknowblogs.blogspot.fr/2016/12/adding-new-role-in-jhipster.html