Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): server browser input follows the preview control permission #16765

ClosedOnkarj012(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/16765/headopened View on GitHub

Showing 2 changed files with 30 additions and 15 deletions.

x
0 of 2 viewed, 2 left
27 additions and 11 deletionsapps/server/src/preview/ServerBrowserStream.test.tsModified
View file
@@ -5,6 +5,7 @@
import {
AuthOrchestrationOperateScope,
AuthOrchestrationReadScope,
+ AuthPreviewOperateScope,
AuthSessionId,
PREVIEW_STREAM_HOST_SETUP_CLOSE_CODE,
PreviewStreamHostSetup,
@@ -64,15 +65,29 @@
];
​
it.effect.each([
- { hasOperateScope: false, interactive: true },
- { hasOperateScope: true, interactive: true },
- { hasOperateScope: true, interactive: false },
-])("streams frames and acks while gating page mutations (%s)", ({ hasOperateScope, interactive }) =>
+ { name: "read only", scopes: [AuthOrchestrationReadScope], interactive: true, canOperate: false },
+ {
+ name: "preview operate",
+ scopes: [AuthOrchestrationReadScope, AuthPreviewOperateScope],
+ interactive: true,
+ canOperate: true,
+ },
+ {
+ name: "preview operate, non-interactive",
+ scopes: [AuthOrchestrationReadScope, AuthPreviewOperateScope],
+ interactive: false,
+ canOperate: false,
+ },