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 e07c48f3f162817be8d5d73e981f589eb648bc1b
1 file changed +2 -2
admin/src/FileForm.ts
+2 -2
@@ -182,8 +182,8 @@ export default function FileForm({ file, addToBar, statusApi, accounts, saved }:
182 const dontShow = [perm, ...onlyTruthy(_.map(show, (v,k) => !v && k))]
183 const others = _.difference(Object.keys(defaultPerms), dontShow)
184 let inherit = file.inherited?.[perm] ?? defaultPerms[perm]
185 - if (typeof inherit === 'string' && _.get(show, inherit) === false) // is 'inherit' referring another permission that is not displayed?
186 - inherit = _.get(values, inherit) ?? _.get(defaultPerms, inherit)! // then show its value instead
185 + while (typeof inherit === 'string' && _.get(show, inherit) === false) // is 'inherit' referring another permission that is not displayed?
186 + inherit = _.get(values, inherit) ?? _.get(file.inherited, inherit) ?? _.get(defaultPerms, inherit)! // then show its value instead
187 return {
188 comp: WhoField,
189 k: perm, sm: 6, xl: 4,