Commit 2ab805d7 authored by Marcelo Rivera's avatar Marcelo Rivera

(feat): enforce delete_post and edit_post permission flags on media view

1 merge request!581WIP: Permissions
Pipeline #87393528 passed with stages
in 52 minutes and 25 seconds
......@@ -163,6 +163,13 @@ export class MediaViewComponent implements OnInit, OnDestroy {
}
delete() {
if (
this.featuresService.has('permissions') &&
!this.permissionsService.canInteract(this.entity, Flags.DELETE_POST)
) {
return;
}
this.client
.delete('api/v1/media/' + this.guid)
.then((response: any) => {
......@@ -198,6 +205,12 @@ export class MediaViewComponent implements OnInit, OnDestroy {
menuOptionSelected(option: string) {
switch (option) {
case 'edit':
if (
this.featuresService.has('permissions') &&
!this.permissionsService.canInteract(this.entity, Flags.EDIT_POST)
) {
return;
}
this.router.navigate(['/media/edit', this.entity.guid]);
break;
case 'delete':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment