ProcessPermission
[<Interface>]
type ProcessPermission =
static member Create (has: Func<string,string option,bool>) : ProcessPermission
abstract member has (scope: string, ?reference: string) : bool| Assembly | Xantham.Fable.Node |
| Attributes | [<Interface>] |
Methods
static member Create (has: Func<string,string option,bool>) : ProcessPermissionabstract member has (scope: string, ?reference: string) : bool
abstract member has (scope: string, ?reference: string) : boolVerifies that the process is able to access the given scope and reference. If no reference is provided, a global scope is assumed, for instance, process.permission.has('fs.read') will check if the process has ALL file system read permissions.
The reference has a meaning based on the provided scope. For example, the reference when the scope is File System means files and folders.
The available scopes are:
fs- All File Systemfs.read- File System read operationsfs.write- File System write operationschild- Child process spawning operationsworker- Worker thread spawning operation
// Check if the process has permission to read the README file
process.permission.has('fs.read', './README.md');
// Check if the process has read permission operations
process.permission.has('fs.read');
@since v20.0.0