From 1196cd23fee52070714867360433728a51c5c136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marina=20L=C3=B3pez?= Date: Fri, 29 Sep 2023 12:37:36 +0200 Subject: [PATCH] feat(workflows): u#2860 t#4036 toast permissions lost --- .../project-feature-shell.component.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell.component.ts b/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell.component.ts index e2c7e77b4..6760742e2 100644 --- a/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell.component.ts +++ b/javascript/apps/taiga/src/app/modules/project/feature-shell/project-feature-shell.component.ts @@ -236,7 +236,18 @@ export class ProjectFeatureShellComponent implements OnDestroy, AfterViewInit { this.wsService.projectEvents('projectroles.update') ) .pipe(untilDestroyed(this)) - .subscribe(() => { + .subscribe((data) => { + const content = data.event.content as { membership: Membership }; + if (!content.membership.role.isAdmin) { + this.appService.toastNotification({ + message: 'errors.admin_permission', + paramsMessage: { + project: content.membership.project?.name, + }, + status: TuiNotification.Error, + closeOnNavigation: false, + }); + } this.store.dispatch( permissionsUpdate({ id: this.state.get('project').id }) );