---
title: "Permissions and approvals"
description: "What each actor may do is a record, changed only by a request, on an administrator's word or a qualified person's approval. Folders are open unless restricted, and every landing meets its requirements and passes the scan for secrets."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.forge.workreef.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Permissions and approvals

What an actor may do in Atoll Forge is two things: its **roles** and its **folder access**. Both are records the forge keeps. Nobody edits a file to change them: every change is a request, which takes effect on an administrator's own word or with another person's approval (always another's where the forge requires it), and goes into the [receipt log](https://docs.forge.workreef.dev/concepts/records/) with whatever approved it.

## Roles

| Role | May |
| --- | --- |
| **Reader** | Read the folders it may read: check out, sync, search, follow events |
| **Writer** | What a reader may, and start, snapshot, submit and abandon changes in the folders it may write |
| **Approver** | What a reader may, and approve a change or a release, its own line's too unless the forge requires another person |
| **Administrator** | What an approver may, and grant roles, restrict folders and change the landing requirements, each on their own word |

Everyone your identity provider lets sign in is a reader and a writer. Approver and administrator are granted, with `af grant`, and an agent's roles come from its [birth](https://docs.forge.workreef.dev/concepts/agents/). An administrator's requests take effect at once, on their word: each is recorded as approved by no one else, and compliance reports list it as an exception. Anyone else's request, for access to a folder or a key, waits until someone who has that access, or an administrator, approves it; no one approves a request of their own line but an administrator.

A forge can require a second administrator instead, the four-eyes principle, with `af-server --two-administrators`: then an administrator's request waits until another administrator approves it, and no one approves their own. An organization with a single administrator still has no one to approve that administrator's requests, so theirs take effect at once, as exceptions.

## Folders

Every folder is open to every reader and writer unless it is **restricted**. A restriction is set on a folder and covers everything under it; it restricts reading and writing, or only writing. Access to a restricted folder is given to a team, as your identity provider names the group, or to a person:

```console server
$ af-server --dev
...
```

```console check
$ source ~/af-dev/dev/env
$ af folder restrict payroll --person dev@localhost --reason "salary data"
done: it took effect at once, on your word as an administrator
$ af folder list
payroll (reads and writes): person dev@localhost
```

Who holds access to a restricted folder is not secret within the organization: anyone signed in to it, person or agent, can list the restrictions and see whom each grants access to, a person by the email they sign in with and a team by its name.

The forge enforces it wherever code moves. A sync never sends a file its reader may not read, not even its deletion; a snapshot that changes a path its writer may not write is refused whole; the log shows a commit that touches a folder you may not read, but not its author, description or paths there. An agent never has more access than its line, checked each time it acts, so taking a person's access away cuts off every agent under them at once.

## Landing requirements

A change lands when it meets every landing requirement that applies to it, as Gerrit's submit requirements decide what may be submitted. By default:

- **Every change:** the checks pass on runners, against exactly the commit that lands. A change's own code runs in its check, so a pass shows it broke nothing the tests catch by mistake, not that it did not cheat on purpose. See [Testing and landing](https://docs.forge.workreef.dev/concepts/testing/).
- **A change to `.forge/`:** a person's approval as well, so no change edits the script that judges it without one.
- **Anyone can ask for a person:** an agent unsure of its change, or an approver who wants to see one first, adds a requirement with `af require`, and the change waits for that approval.

An approval is a signed statement by one person about one commit. **An approval from the change's own line counts** (its author's, or the person's at the root of the agents that wrote it) unless the forge requires another person, with `af-server --two-administrators`; then none from the line counts. Every compliance report lists each approval from a change's own line as an exception.

## The scan for secrets

Every landing is scanned for secrets and regulated data before it lands, inside the forge: secrets with Gitleaks' rule file, read as data, and payment card and bank account numbers that pass their checksums. Text encoded in base64, hex, percent-encoding or unicode escapes is decoded and read again, as Gitleaks decodes it, up to five encodings deep; a secret found that way is placed on the lines of the encoded text it came from. A finding blocks the landing:

```console check
$ af workspace add ~/demo
Workspace at /home/you/demo
Paths: **
main has no landing yet
$ cd ~/demo
$ af new -m "Add a billing fixture"
Working on change tomrqtmxzztsotzvrnkmnukxulxzuwkv at commit cb6de5bfde5e7bbc234cc4674a7f8753df3e36fca6e578eb29888da4a6d0f7a9
$ echo "card: 4111111111111111" > billing.txt
$ af submit
Submitted commit 156a10d5f9d804e33ef332efa01f0f1111198155bce3698fdc82d6955ec854e7, 1 edit in its last snapshot
```

```console eventually
$ af status
Change tomrqtmxzztsotzvrnkmnukxulxzuwkv (submitted) at commit 156a10d5f9d804e33ef332efa01f0f1111198155bce3698fdc82d6955ec854e7
Landing waits for: clearance
The landing scan found 1 thing
```

`af scan` names each finding of the workspace's change: its rule, file and line, and the SHA-256 of what it found, never the finding itself, since receipts are kept for good:

```console check
$ af scan
commit 156a10d5f9d804e33ef332efa01f0f1111198155bce3698fdc82d6955ec854e7: 1 finding, by gitleaks v8.30.1 default rules; atoll-forge regulated data
  rules sha256 eb894a9ed5a3e046adfeea5b6a2745e835fcddd9534b73f545c2a974c3f6103e
  billing.txt:1  payment-card-number  sha256 9bbef19476623ca56c17da75fd57734dbf82530686043a6e491c6d71befe8f6e
```

The landing waits until a person with the approver role (outside the change's line, where the forge requires another person) clears exactly these findings with `af clear`, giving a reason, as GitHub's push protection records why a blocked secret went through. A comment in the file silences nothing: an agent could write one to clear its own finding. [The landing scan](https://docs.forge.workreef.dev/concepts/scanning/) says what it reads and how it judges a match.

## Next

- [`af grant`](https://docs.forge.workreef.dev/reference/af/grant/), [`af folder`](https://docs.forge.workreef.dev/reference/af/folder/), [`af require`](https://docs.forge.workreef.dev/reference/af/require/), [`af scan`](https://docs.forge.workreef.dev/reference/af/scan/) and [`af clear`](https://docs.forge.workreef.dev/reference/af/clear/) in the reference.
- [What the forge records](https://docs.forge.workreef.dev/concepts/records/): the receipts each request and approval leaves.

Source: https://docs.forge.workreef.dev/concepts/permissions/index.mdx
