Skip to content

Commit 1bbebbc

Browse files
committed
fix: restriction manager not falling back to "all" mode if no mode is specified
1 parent 8c5bf11 commit 1bbebbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/restrictions/restriction-manager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class RestrictionsManager extends TypedEmitter<Events> {
147147
}
148148
return Promise.resolve();
149149

150-
} else if (restrictionData.mode === "all") {
150+
} else if (restrictionData.mode === "all" || restrictionData.mode == null) {
151151
const predicatePromises = [];
152152
for (const restriction of restrictions) {
153153
const restrictionDef = this.getRestrictionById(restriction.type);
@@ -165,6 +165,8 @@ class RestrictionsManager extends TypedEmitter<Events> {
165165
}
166166
});
167167
}
168+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors, @typescript-eslint/restrict-template-expressions
169+
return Promise.reject(`Invalid restriction mode '${restrictionData.mode}'`);
168170
}
169171
}
170172

0 commit comments

Comments
 (0)