From f7da089332d136e746ab721e19d627d4f7b7db95 Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Fri, 6 Sep 2019 10:44:43 +0200 Subject: [PATCH] Add more permission checks to file manager Adds permission checks for "can manage logos and fonts" to file manger Fixes a bug where the change detection ignored changes in menus --- .../mediafile-list.component.html | 30 ++++++++++--------- .../mediafile-list.component.ts | 7 ++++- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html index 6e36a968c..d7b8daf9e 100644 --- a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html +++ b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html @@ -172,26 +172,28 @@ - -
-
- +
+ +
+
+ +
-
- -
-
- + +
+
+ +
+
- return ( this.operator.hasPerms('core.can_manage_projector') || this.operator.hasPerms('agenda.can_see_list_of_speakers') || + this.operator.hasPerms('core.can_manage_logos_and_fonts') || this.canEdit ); } @@ -253,6 +254,8 @@ export class MediafileListComponent extends BaseListViewComponent return ( this.operator.hasPerms('agenda.can_see_list_of_speakers') || (file.isProjectable() && this.operator.hasPerms('core.can_manage_projector')) || + (file.isFont() && this.operator.hasPerms('core.can_manage_logos_and_fonts')) || + (file.isImage() && this.operator.hasPerms('core.can_manage_logos_and_fonts')) || this.canEdit ); } @@ -433,7 +436,9 @@ export class MediafileListComponent extends BaseListViewComponent public onManageButton(event: any, file: ViewMediafile, action: string): void { // prohibits automatic closing event.stopPropagation(); - this.mediaManage.setAs(file, action); + this.mediaManage.setAs(file, action).then(() => { + this.cd.markForCheck(); + }); } public createNewFolder(templateRef: TemplateRef): void {