MCPcopy Create free account
hub / github.com/GCWing/BitFun / isPathAllowed

Function isPathAllowed

src/apps/desktop/resources/worker_host.js:40–45  ·  view source on GitHub ↗
(targetPath, mode)

Source from the content-addressed store, hash-verified

38global.rpcEmit = rpcEmit;
39
40function isPathAllowed(targetPath, mode) {
41 if (!policy.fs) return false;
42 const resolved = path.resolve(targetPath);
43 const scopes = mode === 'write' ? (policy.fs.write || []) : (policy.fs.read || []);
44 return scopes.some((scope) => resolved.startsWith(path.resolve(scope)));
45}
46
47function loadStorage() {
48 try {

Callers 1

dispatchFunction · 0.85

Calls 1

resolveMethod · 0.45

Tested by

no test coverage detected