Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
src,permission: fix permission.has on empty param
  • Loading branch information
RafaelGSS committed Nov 10, 2025
commit 1535bdc950e81ff9af23217bfca94cb7dd409195
10 changes: 8 additions & 2 deletions src/permission/fs_permission.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,18 @@ bool FSPermission::is_granted(Environment* env,
case PermissionScope::kFileSystem:
return allow_all_in_ && allow_all_out_;
case PermissionScope::kFileSystemRead:
if (param.empty()) {
return allow_all_in_;
}
return !deny_all_in_ &&
((param.empty() && allow_all_in_) || allow_all_in_ ||
(allow_all_in_ ||
is_tree_granted(env, &granted_in_fs_, param));
case PermissionScope::kFileSystemWrite:
if (param.empty()) {
return allow_all_out_;
}
return !deny_all_out_ &&
((param.empty() && allow_all_out_) || allow_all_out_ ||
(allow_all_out_ ||
is_tree_granted(env, &granted_out_fs_, param));
default:
return false;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-permission-has.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Flags: --permission --allow-fs-read=*
// Flags: --permission --allow-fs-read=* --allow-fs-write=.
'use strict';

const common = require('../common');
Expand Down
Loading