fix: (regression 0.49.0) admin/fs: couldn't reset a permission to its default

Massimo Melina committed Oct 23, 2023 at 10:11 UTC 4adc8afb0d9d41eb9373aedcf1f7175dd0545290
1 file changed +4 -2
admin/src/FileForm.ts
+4 -2
@@ -134,13 +134,15 @@ export default function FileForm({ file, anyMask, addToBar, statusApi }: FileFor
134
135 function perm(perm: keyof VfsPerms, helperText?: ReactNode, props: Partial<WhoFieldProps>={}) {
136 return {
137 + comp: WhoField,
138 + k: perm, lg: 6, xl: 4,
139 + parent, accounts, helperText, isDir,
140 showInherited: anyMask, // with masks, you may need to set a permission to override the mask
141 otherPerms: _.without(Object.keys(defaultPerms), perm).map(x => ({ value: x, label: "As " +perm2word(x) })),
139 - k: perm, lg: 6, xl: 4, comp: WhoField, parent, accounts, helperText,
142 label: "Who can " + perm2word(perm),
143 inherit: file.inherited?.[perm] ?? defaultPerms[perm],
144 byMasks: byMasks?.[perm],
143 - isDir,
145 + fromField: (v?: Who) => v ?? null,
146 ...props
147 }
148 }