mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-24 15:07:17 +00:00
feat(share): report access inherited from a parent folder
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user