This commit is contained in:
2021-10-07 14:00:52 +02:00
parent 361e1b46c6
commit da2ec818ac
14 changed files with 261 additions and 15 deletions
+7 -1
View File
@@ -23,6 +23,7 @@ export class UiMain {
datetimeformat: String;
locales;
authenticated: boolean = false;
moderator: boolean = false;
constructor(
private i18n: I18nService,
@@ -40,8 +41,13 @@ export class UiMain {
this.datetimeformat = this.i18n.get('format.datetime', []);
this.currentLocale = this.i18n.getLocale();
this.locales = this.i18n.getLocales();
this.authService.auth.subscribe(data => {
this.authService.auth.subscribe(auth => {
this.authenticated = true;
for (let role of auth.authorities) {
if (role.authority == 'ROLE_ADMIN' || role.authority == 'ROLE_MOD') {
this.moderator = true;
}
}
}, (error) => {
this.authenticated = false;
})