wtorek, 29 listopada 2016

How to create new ROLE in JHipster


Let’s assume you want to add new role ROLE_MANAGER.

1. In /src/main/resources/config/liquibase/authorities.csv
add ROLE_MANAGER in new line.


In AuthoritiesConstants.java add:

public static final String MANAGER = "ROLE_MANAGER";



2. In /src/main/webapp/app/admin/user-management/user-management.controller.js and user-management-dialog.controller.js
add new role:
vm.authorities = ['ROLE_USER', 'ROLE_ADMIN', 'ROLE_MANAGER'];

3. In
/src/main/webapp/app/account/password/password.state.js
/src/main/webapp/app/account/sessions/sessions.state.js
/src/main/webapp/app/account/settings/settings.state.js

add
authorities: ['ROLE_USER', 'ROLE_MANAGER'],

4. In table jhi_authority
add ROLE_MANAGER


5. In console run:
./mvnw liquibase:clearCheckSums

Brak komentarzy:

Prześlij komentarz