Added impersonation. More data available via auth service about the user. Added admin auth guard.
This commit is contained in:
19
src/app/impersonation/impersonation.component.html
Normal file
19
src/app/impersonation/impersonation.component.html
Normal file
@ -0,0 +1,19 @@
|
||||
@if (isAdmin()) {
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-header>
|
||||
<mat-card-title> Impersonation</mat-card-title>
|
||||
<mat-card-subtitle>Impersonate as another user</mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
<mat-card-actions>
|
||||
<mat-form-field>
|
||||
<mat-label>User to impersonate</mat-label>
|
||||
<mat-select (selectionChange)="onChange($event)" [(value)]="impersonated">
|
||||
<mat-option>{{getUsername()}}</mat-option>
|
||||
@for (user of users; track user) {
|
||||
<mat-option [value]="user.id">{{ user.name }}</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
}
|
Reference in New Issue
Block a user