<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/new-in-symfony-8-2-role-hierarchy-wildcards-and-debugging-symfony-blog--xfbfmcfur" -->

---
title: New in Symfony 8.2: Role Hierarchy Wildcards and...
description: Symfony 8.2 introduces wildcard support in role hierarchy configuration, letting keys like ROLE_BLOG_* automatically match roles such as ROLE_BLOG_COMMENTER...
canonical: https://daily.dev/posts/new-in-symfony-8-2-role-hierarchy-wildcards-and-debugging-symfony-blog--xfbfmcfur
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: New in Symfony 8.2: Role Hierarchy Wildcards and Debugging (Symfony Blog) | daily.dev
og:description: Symfony 8.2 introduces wildcard support in role hierarchy configuration, letting keys like ROLE_BLOG_* automatically match roles such as ROLE_BLOG_COMMENTER...
og:url: https://daily.dev/posts/new-in-symfony-8-2-role-hierarchy-wildcards-and-debugging-symfony-blog--xfbfmcfur
og:image: https://api.daily.dev/og/posts/XfbFmCfUr.png
og:image:alt: New in Symfony 8.2: Role Hierarchy Wildcards and Debugging (Symfony Blog)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

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

# New in Symfony 8.2: Role Hierarchy Wildcards and Debugging (Symfony Blog)

**[Symfony](https://daily.dev/sources/symfony)** · 3 min read · 2 upvotes · 0 comments

## Summary

Symfony 8.2 introduces wildcard support in role hierarchy configuration, letting keys like ROLE_BLOG_* automatically match roles such as ROLE_BLOG_COMMENTER without listing each one explicitly. A new debug:roles console command shows the exact roles granted to a given role, with an optional --tree flag revealing which wildcards were matched. Additionally, the role hierarchy Mermaid chart, previously available via a separate command since Symfony 7.4, is now displayed directly in the profiler's Security panel.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://symfony.com/blog/new-in-symfony-8-2-role-hierarchy-wildcards-and-debugging>

## Questions this post answers

### How do I use wildcards in Symfony's role hierarchy configuration?

Symfony 8.2 allows the * wildcard in role hierarchy keys to match a family of roles at once, for example ROLE_BLOG_*: ROLE_BLOG_READER grants ROLE_BLOG_READER to any role starting with ROLE_BLOG_, even ones not explicitly listed, like ROLE_BLOG_COMMENTER. The wildcard only works when wrapped by underscores or at the end of the role name, and can only appear in hierarchy keys, not in is_granted() calls.

_Track new Symfony security features like this on daily.dev as you plan role-based access upgrades._

### How can I see which exact roles a Symfony role grants after adding wildcards to the role hierarchy?

Symfony 8.2 adds a debug:roles console command that lists every role reachable from a given role, and a --tree option shows which wildcard patterns matched to grant each one. For example, running php bin/console debug:roles ROLE_BLOG_MODERATOR --tree displays ROLE_*, ROLE_*_MODERATOR, and ROLE_BLOG_* as the matched wildcards leading to ROLE_USER, ROLE_MODERATOR, and ROLE_BLOG_READER.

_Developers debugging Symfony role hierarchies can follow tooling changes like this on daily.dev._

## Similar posts on daily.dev

- [New in Symfony 8.1: DX Improvements \(Part 1\) \(Symfony Blog\)](https://daily.dev/posts/new-in-symfony-8-1-dx-improvements-part-1-symfony-blog--sito6mhet) · Symfony · 1 upvotes · 0 comments
- [New in Symfony 8.2: Sudo Mode \(Symfony Blog\)](https://daily.dev/posts/new-in-symfony-8-2-sudo-mode-symfony-blog--tu9o6qvlh) · Symfony · 2 upvotes · 0 comments
- [New in Symfony 8.2: Console sub-commands \(Symfony Blog\)](https://daily.dev/posts/new-in-symfony-8-2-console-sub-commands-symfony-blog--1osa088as) · Symfony · 4 upvotes · 0 comments
- [Class Hierarchy in the Database \(Symfony Blog\)](https://daily.dev/posts/class-hierarchy-in-the-database-symfony-blog--bywgnbdb2) · Symfony · 9 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php), [#symfony](https://daily.dev/tags/symfony), [#authorization](https://daily.dev/tags/authorization)

[View this post on daily.dev](https://daily.dev/posts/new-in-symfony-8-2-role-hierarchy-wildcards-and-debugging-symfony-blog--xfbfmcfur)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"New in Symfony 8.2: Role Hierarchy Wildcards and Debugging (Symfony Blog)","url":"https://daily.dev/posts/new-in-symfony-8-2-role-hierarchy-wildcards-and-debugging-symfony-blog--xfbfmcfur","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/new-in-symfony-8-2-role-hierarchy-wildcards-and-debugging-symfony-blog--xfbfmcfur"},"datePublished":"2026-09-22T07:58:16.121Z","dateModified":"2026-09-22T07:58:36.708Z","description":"Symfony 8.2 introduces wildcard support in role hierarchy configuration, letting keys like ROLE_BLOG_* automatically match roles such as ROLE_BLOG_COMMENTER...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/327b244859fddae8f3a20d0225898aa0?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/327b244859fddae8f3a20d0225898aa0?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Symfony","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Symfony","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/cc07051b7112472f9729e73c14660a64","url":"https://daily.dev/sources/symfony"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/new-in-symfony-8-2-role-hierarchy-wildcards-and-debugging-symfony-blog--xfbfmcfur","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php,symfony,authorization","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Symfony","item":"https://daily.dev/sources/symfony"},{"@type":"ListItem","position":3,"name":"New in Symfony 8.2: Role Hierarchy Wildcards and Debugging (Symfony Blog)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/new-in-symfony-8-2-role-hierarchy-wildcards-and-debugging-symfony-blog--xfbfmcfur#faq","mainEntity":[{"@type":"Question","name":"How do I use wildcards in Symfony's role hierarchy configuration?","acceptedAnswer":{"@type":"Answer","text":"Symfony 8.2 allows the * wildcard in role hierarchy keys to match a family of roles at once, for example ROLE_BLOG_*: ROLE_BLOG_READER grants ROLE_BLOG_READER to any role starting with ROLE_BLOG_, even ones not explicitly listed, like ROLE_BLOG_COMMENTER. The wildcard only works when wrapped by underscores or at the end of the role name, and can only appear in hierarchy keys, not in is_granted() calls. Track new Symfony security features like this on daily.dev as you plan role-based access upgrades."}},{"@type":"Question","name":"How can I see which exact roles a Symfony role grants after adding wildcards to the role hierarchy?","acceptedAnswer":{"@type":"Answer","text":"Symfony 8.2 adds a debug:roles console command that lists every role reachable from a given role, and a --tree option shows which wildcard patterns matched to grant each one. For example, running php bin/console debug:roles ROLE_BLOG_MODERATOR --tree displays ROLE_*, ROLE_*_MODERATOR, and ROLE_BLOG_* as the matched wildcards leading to ROLE_USER, ROLE_MODERATOR, and ROLE_BLOG_READER. Developers debugging Symfony role hierarchies can follow tooling changes like this on daily.dev."}}]}
```

