feat(share): report access inherited from a parent folder

This commit is contained in:
Juan Castro
2026-08-13 13:33:15 -04:00
parent 06248b667a
commit d66c30b1b1
5 changed files with 7 additions and 1 deletions
@@ -245,6 +245,7 @@ export class ShareController extends PuterController {
issuer: share.issuer.username,
holder: share.holder.username,
created_at: share.createdAt,
inherited_from: share.inheritedFrom ?? null,
};
}
+3 -1
View File
@@ -28,7 +28,9 @@ An object with the following properties:
## Return value
A `Promise` that resolves to an array of share objects, each with `uid`, `mode`, `path`, `entryUid`, `isDir`, `issuer` and `holder`.
A `Promise` that resolves to an array of share objects, each with `uid`, `mode`, `path`, `entryUid`, `isDir`, `issuer`, `holder` and `inheritedFrom`.
`inheritedFrom` is the path of the shared ancestor an access comes from, or `null` when the share is on the item itself. Access inherited from a parent folder is **managed on that folder** — withdrawing it here is not possible, because the grant does not live on this item.
The list includes shares granted by **anyone** holding `manage` on the item, not only your own. That is how an owner sees what someone they trusted has re-shared.
+1
View File
@@ -55,6 +55,7 @@ A `Promise` that resolves to an array of share objects, one per recipient/item p
- `isDir` (Boolean) - Whether the shared item is a directory.
- `issuer` (String) - Username of whoever granted the share.
- `holder` (String) - Username of whoever received it.
- `inheritedFrom` (String) - Path of the shared ancestor this access comes from, or `null` when the share is on the item itself.
Sharing the same item with the same person again **replaces** their access rather than adding a second share, so raising someone from `read` to `write` is just another call.
@@ -65,4 +65,5 @@ export const toShare = (row) => ({
isDir: Boolean(row.is_dir ?? row.isDir),
issuer: /** @type {string | null} */ (row.issuer ?? null),
holder: /** @type {string | null} */ (row.holder ?? null),
inheritedFrom: /** @type {string | null} */ (row.inherited_from ?? null),
});
@@ -296,6 +296,7 @@
* @property {boolean} isDir Whether the shared item is a directory.
* @property {string | null} issuer Username of whoever granted it.
* @property {string | null} holder Username of whoever received it.
* @property {string | null} [inheritedFrom] Shared ancestor this access comes from, if any.
*/
/**