Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7542067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:03:56+00:00 2026-05-30T08:03:56+00:00

I have install SonataAdminBundle and configure it manage my Entities, however I have 2

  • 0

I have install SonataAdminBundle and configure it manage my Entities,
however I have 2 Admin Roles : ROLE_ADMIN and ROLE_SUPER_ADMIN and I
want to limit access to some Admin services for ROLE_ADMIN,
I’m using this in security.yml file :

access_control: 
        - { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } 
        - { path: ^/admin/ads, roles: ROLE_SUPER_ADMIN } 
        - { path: ^/admin, roles: ROLE_ADMIN } 
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } 

it’s work perfectly, when a user with ROLE_ADMIN click on manage Ads
link, he will be in Access denied page, but I want to hidden this link in menu
in top Nav and in Dashboard page, how I do this ?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:03:57+00:00Added an answer on May 30, 2026 at 8:03 am

    The default security handler of the SonataAdminBundle is the NOOP implementation, which is always returns true. You have to change the security configuration of the admin bundle.

    With the role based security handler you have to add roles to the security.yml config as described here. For every admin class there is number of role you have to add to your base role in the role hierarchy. If you have an admin class with the id my_bundle.admin.object andmy_bundle.admin.protected_object:

    security:
      role_hierarchy:
        ROLE_SUPER_ADMIN: 
          - ROLE_USER
          - ROLE_ADMIN
          - ROLE_ALLOWED_TO_SWITCH
          - ROLE_MY_BUNDLE_ADMIN_PROTECTED_OBJECT_LIST
          - ROLE_MY_BUNDLE_ADMIN_PROTECTED_OBJECT_EDIT
          ....
        ROLE_ADMIN:
          - ROLE_USER
          - ROLE_SONATA_USER_ADMIN_USER_EDIT
          - ROLE_SONATA_USER_ADMIN_USER_LIST
          - ROLE_MY_BUNDLE_ADMIN_OBJECT_LIST
          - ROLE_MY_BUNDLE_ADMIN_OBJECT_EDIT
          ...
    

    You might have to enumerate all admin/action combination as roles. Maybe implementing a custom security handler based on the RoleSecurityHandler is a better choice if you have large number of admin classes.

    Note I don’t know too much about ACLs in symfony, neither the AclSecurityHandler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have rooted my device and I have install busybox. Now I want to
First I have install Mac 10.6.3 on my system now I want to install
Is there some kind of deployment wizard I can run and have it install
Have install and Configure Joomla 1.5 CMS in my local xampp. After I have
i have install cygwin and configure the ssh service completely but after accessing the
I have install gem rak i want to use rak command inside rake task
i have install mysql to a windows pc (with ip 192.168.1.100) and i have
I have an install of django on apache using embedded wsgi. I DON'T have
i have mac preinstalled svn at ->/usr/bin/svn i have macport install svn at -->opt/local/var/macports/software/subversion/1.6.3_0/opt/local
Obviously I'd like to not have to install an Oracle client (other than simply

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.