0
我創建應用程序使用JHipster 4.0.1與角2,typescript和MongoDb,我試圖添加新的角色。 我向security/AuthoritiesConstants添加了新的常量,但其他步驟是什麼。添加角色jhipster 4.0.1,angular2,打字稿
是否有人知道如何添加我的新角色?
我創建應用程序使用JHipster 4.0.1與角2,typescript和MongoDb,我試圖添加新的角色。 我向security/AuthoritiesConstants添加了新的常量,但其他步驟是什麼。添加角色jhipster 4.0.1,angular2,打字稿
是否有人知道如何添加我的新角色?
所需的步驟已經由角色存儲在數據庫中,並且必須之前供應的How to add new user role to jhipster(4.0.3) application
線程筆者完成。另外,您必須在客戶端添加新角色,以便能夠在用戶管理中將新角色應用於用戶。
你可以找到他們在「/src/main/webapp/app/admin/user-management/user-management-dialog.component.ts」在
ngOnInit() {
this.isSaving = false;
this.authorities = ['ROLE_USER', 'ROLE_ADMIN']; //add more roles here
this.languageHelper.getAll().then((languages) => {
this.languages = languages;
});
this.jhiLanguageService.setLocations(['user-management']);
}
做這一切,加上「ROLE_MANAGER後'到/src/main/java/com/mycompany/myapp/repository/AuthorityRepository.java中。我想因爲角色沒有添加到數據庫 –
你必須將它們添加到src/main/resources/config/liquibase/authorities.csv和之後./mvnw clean/./gradlew clean –
我沒有這個文件我不知道爲什麼我使用mongo shell手動添加ROLE_MANAGER到表jhi_authority中,它工作良好。謝謝 –