fix: checkVfsPermission return value not working
Massimo Melina committed
Sep 5, 2025 at 01:16 UTC
a30aa9b53a08825f7fe9c09c62396d71df045c55
3 files changed
+6
-4
dev-plugins.md
+3
-1
@@ -1060,4 +1060,6 @@ If you want to override a text regardless of the language, use the special langu
1060
- 12.9 (v0.57.14)
1061
- frontend event fileShow gets Component parameter
1062
- 12.91 (v0.57.15)
1063
- - HFS.isVideoComponent, HFS.markVideoComponent, HFS.isAudioComponent, HFS.markAudioComponent
\ No newline at end of file
1063
+ - HFS.isVideoComponent, HFS.markVideoComponent, HFS.isAudioComponent, HFS.markAudioComponent
1064
+- 12.92 (v0.57.16)
1065
+ - fixed checkVfsPermission
\ No newline at end of file
src/const.ts
+1
-1
@@ -9,7 +9,7 @@ import { formatTimestamp } from './cross'
9
import { argv } from './argv'
10
export * from './cross-const'
11
12
-export const API_VERSION = 12.91
12
+export const API_VERSION = 12.92
13
export const COMPATIBLE_API_VERSION = 1 // while changes in the api are not breaking, this number stays the same, otherwise it is made equal to API_VERSION
14
15
// you can add arguments with this file, currently used for the update process on mac/linux
src/vfs.ts
+2
-2
@@ -268,8 +268,8 @@ export function statusCodeForMissingPerm(node: VfsNode, perm: keyof VfsPerms, ct
268
} while (1)
269
const eventName = 'checkVfsPermission'
270
if (events.anyListener(eventName)) {
271
- const first = Number(events.emit(eventName, { who, node, perm, ctx })?.find(Boolean))
272
- if (first >= 400)
271
+ const first = _.max(events.emit(eventName, { who, node, perm, ctx }))
272
+ if (first !== undefined)
273
return first
274
}
275