Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Asking Permission

In the last chapter, a script was refused until it was given a folder to read. This chapter covers the permissions a script can be given, and the rules behind them.

Four of them name a place, a variable or a program, and each one has its own flag:

FlagWhat it grantsExample
--allow-read DIRreading files under DIR--allow-read ./docs
--allow-write DIRwriting files under DIR--allow-write ./build
--allow-env NAMEreading and setting the variable NAME--allow-env HOME
--allow-exec PROGRAMrunning the program PROGRAM--allow-exec git

Every flag can be repeated, so a script can be granted several folders, names or programs.

A permission in airsl is called a grant. Each grant names exactly what it covers: a folder, a variable, a program. There is no "may read files" or "may run programs". There is only "may read files here" and "may run this program".

A fifth, smaller kind of permission names no place at all: writing output, reading the clock, using a relative path. It is called host access, and it has its own flag, --allow-access. It is covered under Host access.