fix: admin/fs: wrong value displayed for web-links with an inherited can_see value of type as-permission
Massimo Melina committed
May 28, 2024 at 23:42 UTC
5e6d726e8caf9c193fe49e1b14fa48470dec1122
1 file changed
+2
-2
admin/src/FileForm.ts
+2
-2
@@ -190,8 +190,8 @@ export default function FileForm({ file, addToBar, statusApi, accounts, saved }:
190
const dontShow = [perm, ...onlyTruthy(_.map(show, (v,k) => !v && k))]
191
const others = _.difference(Object.keys(defaultPerms), dontShow)
192
let inherit = file.inherited?.[perm] ?? defaultPerms[perm]
193
- if (typeof inherit === 'string' && _.get(show, inherit) === false) // is 'inherit' referring another permission that is not displayed?
194
- inherit = _.get(values, inherit) ?? _.get(defaultPerms, inherit)! // then show its value instead
193
+ while (typeof inherit === 'string' && _.get(show, inherit) === false) // is 'inherit' referring another permission that is not displayed?
194
+ inherit = _.get(values, inherit) ?? _.get(file.inherited, inherit) ?? _.get(defaultPerms, inherit)! // then show its value instead
195
return {
196
comp: WhoField,
197
k: perm, sm: 6, xl: 4,