aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-06-27 22:54:06 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-06-27 22:54:06 -0400
commitbacf327d709af79ccc207a1aef27dfb72e70ac40 (patch)
tree90ded472814e243106dbe75e0311028b42647238 /src/client/DocServer.ts
parentb340defb4a4b8c5b7604099e7b0fb5b6846f70aa (diff)
set LivePlayground to be the default for view-oriented fields
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r--src/client/DocServer.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index c7dfb0b23..2a7a7c59a 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -31,16 +31,19 @@ export namespace DocServer {
export enum WriteMode {
Default = 0, //Anything goes
- Playground = 1,
- LiveReadonly = 2,
- LivePlayground = 3,
+ Playground = 1, //Playground (write own/no read)
+ LiveReadonly = 2,//Live Readonly (no write/read others)
+ LivePlayground = 3,//Live Playground (write own/read others)
}
-
- export let AclsMode = WriteMode.Default;
-
const fieldWriteModes: { [field: string]: WriteMode } = {};
const docsWithUpdates: { [field: string]: Set<Doc> } = {};
+ export var PlaygroundFields: string[];
+ export function setPlaygroundFields(livePlayougroundFields: string[]) {
+ DocServer.PlaygroundFields = livePlayougroundFields;
+ livePlayougroundFields.forEach(f => DocServer.setFieldWriteMode(f, DocServer.WriteMode.LivePlayground));
+ }
+
export function setFieldWriteMode(field: string, writeMode: WriteMode) {
fieldWriteModes[field] = writeMode;
if (writeMode !== WriteMode.Playground) {