| 1425 | : baseGrants; |
| 1426 | |
| 1427 | const markInheritFlags = (map, defaultVal) => { |
| 1428 | if (!map || typeof map !== "object") return; |
| 1429 | Object.keys(map).forEach(key => { |
| 1430 | const entry = map[key]; |
| 1431 | if (!entry || typeof entry !== "object") return; |
| 1432 | if (typeof entry.__explicit === "undefined") { |
| 1433 | if (typeof entry.explicit !== "undefined") { |
| 1434 | entry.__explicit = !!entry.explicit; |
| 1435 | } else { |
| 1436 | entry.__explicit = !!defaultVal; |
| 1437 | } |
| 1438 | } else { |
| 1439 | entry.__explicit = !!entry.__explicit; |
| 1440 | } |
| 1441 | if (typeof entry.__inherit === "undefined") { |
| 1442 | if (typeof entry.inherit !== "undefined") { |
| 1443 | entry.__inherit = !!entry.inherit; |
| 1444 | } else { |
| 1445 | entry.__inherit = !!defaultVal; |
| 1446 | } |
| 1447 | } else { |
| 1448 | entry.__inherit = !!entry.__inherit; |
| 1449 | } |
| 1450 | }); |
| 1451 | }; |
| 1452 | markInheritFlags(grants, isAdmin); |
| 1453 | renderFolderGrantsUI( |
| 1454 | username, |