> For the complete documentation index, see [llms.txt](https://acf.spomky-labs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://acf.spomky-labs.com/readme.md).

# Access Control: authorization for your PHP applications

**Access Control** decides whether a requester is allowed to perform an action on a subject.

It is authorization on its own. Voters, combining algorithms, access policies declared as attributes, and decisions that say why they were reached: none of it needs an authentication stack to exist. There is no user, no token and no firewall in the vocabulary, and a requester is whatever your application says it is.

```php
$decision = $accessControlManager->decide(new AccessRequest($requester, 'EDIT', $post));

if (! $decision->isGranted()) {
    throw new AccessDeniedException($decision->reason);
}
```

The same question, asked from a controller of a Symfony application:

```php
#[AccessPolicy('EDIT', new Argument('post'))]
public function edit(Post $post): Response
{
    // ...
}
```

## Two packages

| Package                             | What it is                                            |
| ----------------------------------- | ----------------------------------------------------- |
| `spomky-labs/access-control-lib`    | The library, usable in any PHP application            |
| `spomky-labs/access-control-bundle` | The integration into the Symfony full-stack framework |

Both are read-only subtree splits of [access-control-framework](https://github.com/spomky-labs/access-control-framework), where issues and pull requests belong.

## Coming from Symfony Security

Installing the bundle changes nothing you can see. Your voters keep being consulted, `#[IsGranted]` is read, `is_granted()` answers in your templates, and the rules of your `security.yaml` are enforced. What changed is who decides. Moving to this component's own vocabulary is a second, separate migration you make at your own pace, and [The Two Migrations](/migration/the-two-migrations.md) explains why confusing the two would cost you the adoption.

## Where to start

* [What is Access Control?](/the-project/the-project.md) if you want the shape of the thing first.
* [Installation](/the-project/installation.md) if you want to try it now.
* [Vocabulary](/access-control-in-a-nutshell/vocabulary.md) if a word here already means something else to you. It probably does: `subject` is the resource, not the actor.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://acf.spomky-labs.com/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
