Browse Source

fix: add missing isDj to _hasPermission of station deleted/updated events

Kristian Vos 8 months ago
parent
commit
a6d077292e

+ 2 - 0
backend/src/modules/DataModule/models/stations/events/StationDeletedEvent.ts

@@ -2,6 +2,7 @@ import ModelDeletedEvent from "@/modules/DataModule/ModelDeletedEvent";
 import isUnlisted from "@/modules/DataModule/permissions/isUnlisted";
 import isPublic from "@/modules/DataModule/permissions/isPublic";
 import isOwner from "@/modules/DataModule/permissions/isOwner";
+import isDj from "@/modules/DataModule/permissions/isDj";
 
 export default abstract class StationDeletedEvent extends ModelDeletedEvent {
 	protected static _modelName = "stations";
@@ -9,6 +10,7 @@ export default abstract class StationDeletedEvent extends ModelDeletedEvent {
 	protected static _hasPermission = [
 		isPublic,
 		isUnlisted,
+		isDj,
 		isOwner // TODO only check isOwner for community stations, if owner = user id
 	];
 }

+ 2 - 0
backend/src/modules/DataModule/models/stations/events/StationUpdatedEvent.ts

@@ -2,6 +2,7 @@ import ModelUpdatedEvent from "@/modules/DataModule/ModelUpdatedEvent";
 import isPublic from "@/modules/DataModule/permissions/isPublic";
 import isUnlisted from "@/modules/DataModule/permissions/isUnlisted";
 import isOwner from "@/modules/DataModule/permissions/isOwner";
+import isDj from "@/modules/DataModule/permissions/isDj";
 
 export default abstract class StationUpdatedEvent extends ModelUpdatedEvent {
 	protected static _modelName = "stations";
@@ -9,6 +10,7 @@ export default abstract class StationUpdatedEvent extends ModelUpdatedEvent {
 	protected static _hasPermission = [
 		isPublic,
 		isUnlisted,
+		isDj,
 		isOwner // TODO only check isOwner for community stations, if owner = user id
 	];
 }