diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/PropertiesView.tsx | 1 | ||||
-rw-r--r-- | src/fields/util.ts | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index 9209cc21a..6aad94131 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -320,6 +320,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { getPermissionsSelect(user: string, permission: string) { const dropdownValues: string[] = Object.values(SharingPermissions); if (permission === "-multiple-") dropdownValues.unshift(permission); + if (name === "Override") dropdownValues.unshift("Unset"); return <select className="permissions-select" value={permission} onChange={e => this.changePermissions(e, user)}> diff --git a/src/fields/util.ts b/src/fields/util.ts index fa1c47055..20ba1ca39 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -173,11 +173,6 @@ export function GetEffectiveAcl(target: any, in_prop?: string | symbol | number, // if the acl is being overriden or the property being modified is one of the playground fields (which can be freely modified) if (_overrideAcl || (in_prop && DocServer.PlaygroundFields?.includes(in_prop.toString()))) return AclEdit; - // if there's an overriding acl set through the properties panel or sharing menu, that's what's returned. - // if it's unset, it just goes ahead - const override = target[AclSym]["acl-Override"]; - if (override !== AclUnset && override !== undefined) return target[AclSym]["acl-Override"]; - let effectiveAcl = AclPrivate; const HierarchyMapping = new Map<symbol, number>([ [AclPrivate, 0], @@ -194,10 +189,15 @@ export function GetEffectiveAcl(target: any, in_prop?: string | symbol | number, if (currentUserGroups.includes(entity) || userChecked === entity) { if (HierarchyMapping.get(value as symbol)! > HierarchyMapping.get(effectiveAcl)!) { effectiveAcl = value as symbol; - if (effectiveAcl === AclAdmin) break; + if (effectiveAcl === AclAdmin) return effectiveAcl; } } } + + // if there's an overriding acl set through the properties panel or sharing menu, that's what's returned if the user isn't an admin of the document + const override = target[AclSym]["acl-Override"]; + if (override !== AclUnset && override !== undefined) effectiveAcl = target[AclSym]["acl-Override"]; + // if we're in playground mode, return AclEdit (or AclAdmin if that's the user's effectiveAcl) return DocServer?.Control?.isReadOnly?.() && HierarchyMapping.get(effectiveAcl)! < 3 ? AclEdit : effectiveAcl; } |