aboutsummaryrefslogtreecommitdiff
path: root/src/fields/util.ts
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-06-15 11:18:19 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-06-15 11:18:19 -0400
commit3225f565acd8edaac5992f9766dc66ac5547257f (patch)
treefe4de3b24e0a6c2143c2605934c68c483e1660af /src/fields/util.ts
parent35793fc1da7633da7c474317b0df83b4368a9b10 (diff)
more merge fixes
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r--src/fields/util.ts47
1 files changed, 26 insertions, 21 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts
index 6058a5a5f..e0f87f805 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -8,27 +8,32 @@ import { UndoManager } from '../client/util/UndoManager';
import { returnZero } from '../Utils';
import CursorField from './CursorField';
import {
- AclAdmin,
- AclEdit,
- aclLevel,
- AclPrivate,
- AclSelfEdit,
- AclSym,
- DataSym,
Doc,
+ aclLevel,
DocListCast,
DocListCastAsync,
- ForceServerWrite,
- HeightSym,
HierarchyMapping,
- Initializing,
- LayoutSym,
ReverseHierarchyMap,
updateCachedAcls,
- UpdatingFromServer,
- WidthSym,
} from './Doc';
-import { Id, OnUpdate, Parent, SelfProxy, ToValue, Update } from './FieldSymbols';
+import {
+ AclAdmin,
+ AclEdit,
+ AclPrivate,
+ AclAugment,
+ FieldKeys,
+ DocAcl,
+ DocData,
+ ForceServerWrite,
+ Height,
+ Initializing,
+ DocLayout,
+ UpdatingFromServer,
+ Width,
+ SelfProxy,
+ Update
+} from './DocSymbols';
+import { Id, OnUpdate, Parent, ToValue } from './FieldSymbols';
import { List } from './List';
import { ObjectField } from './ObjectField';
import { PrefetchProxy, ProxyField } from './Proxy';
@@ -150,12 +155,12 @@ export function denormalizeEmail(email: string) {
*/
export function inheritParentAcls(parent: Doc, child: Doc) {
return;
- const dataDoc = parent[DataSym];
- for (const key of Object.keys(dataDoc)) {
- // if the default acl mode is private, then don't inherit the acl-Public permission, but set it to private.
- const permission = key === 'acl-Public' && Doc.defaultAclPrivate ? AclPrivate : dataDoc[key];
- key.startsWith('acl') && distributeAcls(key, permission, child);
- }
+ // const dataDoc = parent[DocData];
+ // for (const key of Object.keys(dataDoc)) {
+ // // if the default acl mode is private, then don't inherit the acl-Public permission, but set it to private.
+ // const permission = key === 'acl-Public' && Doc.defaultAclPrivate ? AclPrivate : dataDoc[key];
+ // key.startsWith('acl') && distributeAcls(key, permission, child);
+ // }
}
/**
@@ -214,7 +219,7 @@ export function SetCachedGroups(groups: string[]) {
runInAction(() => cachedGroups.push(...groups));
}
function getEffectiveAcl(target: any, user?: string): symbol {
- const targetAcls = target[AclSym];
+ const targetAcls = target[DocAcl];
if (targetAcls?.['acl-Me'] === AclAdmin || GetCachedGroupByName('Admin')) return AclAdmin;
const userChecked = user || Doc.CurrentUserEmail; // if the current user is the author of the document / the current user is a member of the admin group