File tree Expand file tree Collapse file tree
src/app/features/profile/components/user-profile-security Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,15 @@ <h2>User Profile & Security</h2>
2121 </ div >
2222
2323 < div class ="profile-header__actions ">
24- < button pButton type ="button " label ="Create Account " icon ="pi pi-user-plus " class ="p-button-outlined " (click) ="register() "> </ button >
24+ < button
25+ *ngIf ="canCreateAccount() "
26+ pButton
27+ type ="button "
28+ label ="Create Account "
29+ icon ="pi pi-user-plus "
30+ class ="p-button-outlined "
31+ (click) ="register() ">
32+ </ button >
2533 < button pButton type ="button " label ="Logout " icon ="pi pi-sign-out " class ="p-button-outlined " (click) ="logout() "> </ button >
2634 </ div >
2735 </ div >
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export class UserProfileSecurityComponent {
2323 readonly claims = computed ( ( ) => this . authService . userClaims ( ) ) ;
2424 readonly roles = computed ( ( ) => this . authService . userRoles ( ) ) ;
2525 readonly currentUserId = computed ( ( ) => this . authService . currentUserId ( ) ) ;
26+ readonly canCreateAccount = computed ( ( ) => this . authService . hasRole ( 'Administrator' ) ) ;
2627
2728 readonly userDisplayName = computed ( ( ) => {
2829 const claims = this . claims ( ) ;
You can’t perform that action at this time.
0 commit comments