flagging
This commit is contained in:
@@ -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;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user