hl.permission

hl.permission(binary, type, mode)

Add a dynamic permission rule.

Signature

hl.permission(binary: string, type: string, mode: string): nil
hl.permission(spec: HL.PermissionSpec): nil

Parameters

binarystring

Binary name or target. Must not be empty.

typestring

Permission type.

Accepted values:

  • screencopy

  • cursorpos

  • plugin

  • keyboard

  • keeb alias for keyboard

modestring

Permission mode.

Accepted values:

  • ask

  • allow

  • deny

specHL.PermissionSpec

Table form. binary may also be written as target.

Returns

nil

This function registers the permission rule and does not return a value.

Examples

Positional form:

hl.permission("grim", "screencopy", "allow")

Table form:

hl.permission({
    binary = "my-plugin",
    type = "plugin",
    mode = "ask",
})

See also

HL.PermissionSpec

Table form accepted by this function.