Merge pull request #4985 from tsiegleauq/more-mediafile-permission
Add more permission checks to file manager
This commit is contained in:
commit
84bb091e0f
@ -172,26 +172,28 @@
|
||||
<!-- Menu for single files in the list -->
|
||||
<mat-menu #singleMediafileMenu="matMenu">
|
||||
<ng-template matMenuContent let-mediafile="mediafile">
|
||||
<!-- Exclusive for images -->
|
||||
<div *ngIf="mediafile.isImage() && canEdit">
|
||||
<div *ngFor="let action of logoActions">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="manageButton; context: { mediafile: mediafile, action: action }"
|
||||
></ng-container>
|
||||
<div *osPerms="'core.can_manage_logos_and_fonts'">
|
||||
<!-- Exclusive for images -->
|
||||
<div *ngIf="mediafile.isImage()">
|
||||
<div *ngFor="let action of logoActions">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="manageButton; context: { mediafile: mediafile, action: action }"
|
||||
></ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Exclusive for fonts -->
|
||||
<div *ngIf="mediafile.isFont() && canEdit">
|
||||
<div *ngFor="let action of fontActions">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="manageButton; context: { mediafile: mediafile, action: action }"
|
||||
></ng-container>
|
||||
<!-- Exclusive for fonts -->
|
||||
<div *ngIf="mediafile.isFont()">
|
||||
<div *ngFor="let action of fontActions">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="manageButton; context: { mediafile: mediafile, action: action }"
|
||||
></ng-container>
|
||||
</div>
|
||||
</div>
|
||||
<mat-divider *ngIf="mediafile.isFont() || mediafile.isImage()"></mat-divider>
|
||||
</div>
|
||||
|
||||
<!-- Edit and delete for all images -->
|
||||
<mat-divider *ngIf="mediafile.isFont() || mediafile.isImage()"></mat-divider>
|
||||
<os-projector-button
|
||||
*ngIf="mediafile.isProjectable()"
|
||||
[object]="mediafile"
|
||||
|
@ -81,6 +81,7 @@ export class MediafileListComponent extends BaseListViewComponent<ViewMediafile>
|
||||
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<ViewMediafile>
|
||||
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<ViewMediafile>
|
||||
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<string>): void {
|
||||
|
Loading…
Reference in New Issue
Block a user