> 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/the-symfony-bundle/installation.md).

# Installation

```bash
composer require spomky-labs/access-control-bundle
```

```php
// config/bundles.php
return [
    // ...
    AccessControl\Bundle\AccessControlBundle::class => ['all' => true],
];
```

**There is no `enabled` flag. Registering the bundle is the opt-in**, and it is what makes the component take over the authorization entry points.

## What registering it changes

Immediately, and without touching a line of your code or your configuration:

| Entry point                     | Before                | After                                                                                |
| ------------------------------- | --------------------- | ------------------------------------------------------------------------------------ |
| `#[IsGranted]`                  | Security's listener   | [This component's](/the-symfony-bundle/controllers.md#isgranted-keeps-working)       |
| `is_granted()` in Twig          | Security's extension  | [This component's](/the-symfony-bundle/templates.md)                                 |
| `security.access_control` rules | Security's access map | This component's decision manager                                                    |
| `security.role_hierarchy`       | Security              | [Shared: one tree, both stacks](/the-symfony-bundle/configuration.md#role-hierarchy) |
| Your voters                     | Consulted by Security | [Consulted here, unchanged](/migration/from-security.md)                             |
| Workflow guards                 | Security's listener   | Security's, unless you have no Security                                              |

The answers do not change. Your `security.yaml` stays byte for byte what it was. See [The Two Migrations](/migration/the-two-migrations.md).

## Check it took over

Open any page with the profiler on: the **Configuration** tab of the Access Control panel names which stack answers what. If it still says `security` where you expected `component`, the bridge did not take over and you want to know now rather than later. See [The Profiler Panel](/the-symfony-bundle/profiler.md).

## One case where it will not install

An application using **field level ACL** in its templates, that is `is_granted('EDIT', $post, 'title')`, cannot register this bundle: no voter here understands a `FieldVote`, and rather than answering `false`, which a template cannot tell from a real refusal, the function raises. See [Templates](/the-symfony-bundle/templates.md#field-level-access-control-is-refused-loudly).

## If you have no Security at all

Everything above still applies, minus the takeovers. Two things need a word:

* `AbstractController::isGranted()` and `denyAccessUnlessGranted()` need [a trait](/the-symfony-bundle/controllers.md#isgranted-and-denyaccessunlessgranted-without-security),
* workflow guards need `symfony/security-core` **installed** though never used, see [Workflow Guards](/the-symfony-bundle/workflow.md).

Then tell the component who is asking, since there is no token to read: see [Requesters and Actors](/access-control-in-a-nutshell/requesters.md#telling-the-component-who-is-asking).

## Configuration

None is required. Everything has a default, and the settings live under one root key. See [Configuration](/the-symfony-bundle/configuration.md).


---

# 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/the-symfony-bundle/installation.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.
