|
@@ -16,5 +16,15 @@ export class HomeComponent implements OnInit {
|
|
|
username: this.token.getUsername(),
|
|
username: this.token.getUsername(),
|
|
|
authorities: this.token.getAuthorities()
|
|
authorities: this.token.getAuthorities()
|
|
|
};
|
|
};
|
|
|
|
|
+ this.mapAuthorities();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ mapAuthorities(){
|
|
|
|
|
+ if(Array.isArray(this.info.authorities)){
|
|
|
|
|
+ this.info.authorities = this.info.authorities.map((authority: string) => {
|
|
|
|
|
+ const trimmedAuthority = authority.replace('ROLE_', '').toLowerCase();
|
|
|
|
|
+ return trimmedAuthority.charAt(0).toUpperCase() + trimmedAuthority.slice(1);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|