PHPackages                             madesst/security-extra-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. madesst/security-extra-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

madesst/security-extra-bundle
=============================

Add route names support in security.yml

318[1 issues](https://github.com/madesst/MadesstSecurityExtraBundle/issues)PHP

Since Jan 28Pushed 13y ago2 watchersCompare

[ Source](https://github.com/madesst/MadesstSecurityExtraBundle)[ Packagist](https://packagist.org/packages/madesst/security-extra-bundle)[ RSS](/packages/madesst-security-extra-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MadesstSecurityExtraBundle
==========================

[](#madesstsecurityextrabundle)

About problem and bundle
------------------------

[](#about-problem-and-bundle)

At first look at security.yml example from documentation:

```
# app/config/security.yml
security:
	# ...
	access_control:
		- { path: ^/admin/users, roles: ROLE_SUPER_ADMIN } # Look at path attribute. Fabien, wtf?
		- { path: ^/admin, roles: ROLE_ADMIN }

```

I think that default workflow with security configuration is a bit strange. I don't understand why i must support two similar definitions of URL paths in routing.yml and security.yml. Same time i don't want to use annotations because i prefer look at one yml without jumping from one controller to another.

MadesstSecurityExtraBundle extends security.yml so you can use your route names from routing.yml and rewrite previous example:

```
# app/config/security.yml
security:
	# ...
	access_control:
		- { path: '@my_bundle_admin_users', roles: ROLE_SUPER_ADMIN }
		- { path: '@my_bundle_admin', roles: ROLE_ADMIN }

```

And look routing.yml for explaining:

```
# app/config/routing.yml
my_bundle_admin:
    pattern:  /admin
    defaults: { _controller: MyBundle:Admin:index}
my_bundle_admin_users:
	pattern:  /admin/users
	defaults: { _controller: MyBundle:Admin:users}

```

Old style syntax is also supported, don't worry. You can use pattern string in path, nothing will be broken.

Installation
------------

[](#installation)

Add bundle into your `composer.json`:

```
{
    "require": {
        "madesst/security-extra-bundle": "dev-master"
    }
}

```

And register it into `app/AppKernel.php`:

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Madesst\SecurityExtraBundle\MadesstSecurityExtraBundle(),
    );
}

```

Add line to parameters.yml

```
// app/config/parameters.yml
security.matcher.class: Madesst\SecurityExtraBundle\Common\RequestMatcher

```

That all!

Advanced routes
---------------

[](#advanced-routes)

MadesstSecurityExtraBundle supports simple wildcards, for that cases when you have routing.yml with a specific naming convention, for a stupid example:

```
# app/config/routing.yml
my_bundle_post:
    pattern:  /post/{id}
    defaults: { _controller: MadesstSecurityExtraBundle:Default:read}
my_bundle_post_edit:
    pattern:  /post/edit/{id}
    defaults: { _controller: MadesstSecurityExtraBundle:Default:update}
my_bundle_post_create:
    pattern:  /post/create
    defaults: { _controller: MadesstSecurityExtraBundle:Default:create}
my_bundle_post_delete:
    pattern:  /post/delete/{id}
    defaults: { _controller: MadesstSecurityExtraBundle:Default:delete}

```

So, you want that all users can read post, registered users can write new post and editing existing posts, and only admins can delete posts. And all with ESI caching =) Let's write simple security.yml for this:

```
# app/config/security.yml
security:
    firewalls:
        secured_area:
            pattern:    '@*' # Equals to '^/' in old syntax
            anonymous:  ~
            form_login:
                login_path:  '_demo_login'
                check_path:  '_security_check'

    access_control:
        - { path: '@my_bundle_post_delete', roles: ROLE_ADMIN}
        - { path: '@my_bundle_post_*', roles: ROLE_USER}
        - { path: '@my_bundle_post', roles: IS_AUTHENTICATED_ANONYMOUSLY}
		- { path: ^/esi, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }
		- { path: ^/esi, roles: ROLE_NO_ACCESS }

```

License
-------

[](#license)

Released under the MIT License, see LICENSE.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a36e008b5a79dd919ab6be402a46a4754286be42cfbb3a92f566b44ad0ddbff?d=identicon)[madesst](/maintainers/madesst)

---

Top Contributors

[![madesst](https://avatars.githubusercontent.com/u/300694?v=4)](https://github.com/madesst "madesst (1 commits)")

### Embed Badge

![Health badge](/badges/madesst-security-extra-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/madesst-security-extra-bundle/health.svg)](https://phpackages.com/packages/madesst-security-extra-bundle)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
