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