frontend: add admin check to display quick actions in video room
This commit is contained in:
parent
af0882bb1d
commit
9cdba7259f
@ -95,12 +95,14 @@
|
||||
</div>
|
||||
|
||||
<!-- Quick Actions -->
|
||||
<div class="quick-actions fade-in-delayed-more">
|
||||
<button mat-button class="quick-action-button" (click)="goBack()">
|
||||
<mat-icon>arrow_back</mat-icon>
|
||||
<span>Back to Rooms</span>
|
||||
</button>
|
||||
</div>
|
||||
@if (isAdmin) {
|
||||
<div class="quick-actions fade-in-delayed-more">
|
||||
<button mat-button class="quick-action-button" (click)="goBack()">
|
||||
<mat-icon>arrow_back</mat-icon>
|
||||
<span>Back to Rooms</span>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
} @else {
|
||||
|
||||
@ -105,6 +105,10 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
|
||||
this.wcManagerService.stopCommandsListener();
|
||||
}
|
||||
|
||||
get isAdmin(): boolean {
|
||||
return this.authService.isAdmin();
|
||||
}
|
||||
|
||||
async submitAccessRoom() {
|
||||
const { valid, value } = this.participantForm;
|
||||
if (!valid || !value.name?.trim()) {
|
||||
|
||||
@ -67,6 +67,10 @@ export class AuthService {
|
||||
return this.user?.roles;
|
||||
}
|
||||
|
||||
isAdmin(): boolean {
|
||||
return this.user?.roles.includes(UserRole.ADMIN) || false;
|
||||
}
|
||||
|
||||
private async getAuthenticatedUser(force = false) {
|
||||
if (force || (!this.user && !this.hasCheckAuth)) {
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user