mirror of
https://github.com/HeyPuter/puter.git
synced 2026-10-13 15:20:26 +00:00
docs: say why AppDriver.select lists apps it does not own
Reads as the same enumeration surface `/query/app` refuses to be, so write down that it is not: `/query/app` answers for apps the caller names, which is why it must not confirm one it may not see. `select` is the listing a launcher reads, and a listing that hid every app but your own would not be one. Protected apps are still filtered by the permission check, and `user-can-edit` narrows it to the caller's own. A test already pins the behaviour by name; this is the reason behind it.
This commit is contained in:
1 parent
cbb8d708b4
commit
4629b544e6
1 file changed
+7
@@ -337,6 +337,13 @@ export class AppDriver extends PuterDriver {
|
||||
return this.#toClient(app, actor, { ...params, stats });
|
||||
}
|
||||
|
||||
/**
|
||||
* Paged app listing. Unlike `/query/app`, which answers only for apps named
|
||||
* by the caller and so must not confirm ones it may not see, this is the
|
||||
* listing surface a launcher reads: `protected` apps are filtered by the
|
||||
* permission check below, and everything else is listable by design. Narrow
|
||||
* it with `predicate: ['user-can-edit']` to the caller's own.
|
||||
*/
|
||||
async select(args = {}) {
|
||||
const { predicate, params = {} } = args;
|
||||
const actor = this.#requireActor();
|
||||
|
||||
Reference in new issue
Block a user