Module security

Library for managing process permissions

Functions

revoke (pid) Revoke all permissions from the given process
requestPermission (perm) Request a permission to the parent process
hasPermission (perm[, pid=current]) Returns whether the given or current process has the given permission.
requirePermission (perm) Function to throw an error if the current process doesn't have the given permission.
getPermissions ([pid=current]) Returns the list of all the permissions the given or current process has.


Functions

revoke (pid)
Revoke all permissions from the given process

Required permissions:

    security.revoke

Parameters:

  • pid int The PID of the process from which permissions will be removed
requestPermission (perm)
Request a permission to the parent process

Parameters:

  • perm string requested permission

Returns:

  1. bool true if the was the permission given
  2. optional string details on why the permission was not given
hasPermission (perm[, pid=current])
Returns whether the given or current process has the given permission.

Parameters:

  • perm string permission to be checked
  • pid int The PID of the process to check if it has or not the given permission (default current)

Returns:

    bool Whether the process has the given permission
requirePermission (perm)
Function to throw an error if the current process doesn't have the given permission.

Parameters:

  • perm string permission to be checked

Usage:

    security.requestPermission("permission.cool")
    security.requirePermission("permission.cool")
    -- guarenteed to have the 'permission.cool' permission
getPermissions ([pid=current])
Returns the list of all the permissions the given or current process has.

Parameters:

  • pid int The PID of the process (default current)
generated by LDoc 1.4.6 Last updated 2021-12-27 19:58:59