sonata-project/SonataAdminBundle — Issue #330: ACL handler broken?
Author: zhil
Created: 2011-10-11 10:49:06+00:00
State: open

Do ACL security handler working now?

Trying to use SonataAdminBundle + SonataUserBundle + FOSUserBundle
Setup everythig, but my ROLE_SUPER_ADMIN don't grant me anything

php app/console container:debug --env=prod | grep 'admin'

sonata.admin.builder.filter.factory container Sonata\AdminBundle\Filter\FilterFactory
sonata.admin.builder.orm_datagrid container Sonata\AdminBundle\Builder\ORM\DatagridBuilder
sonata.admin.builder.orm_form container Sonata\AdminBundle\Builder\ORM\FormContractor
sonata.admin.builder.orm_list container Sonata\AdminBundle\Builder\ORM\ListBuilder
sonata.admin.builder.orm_show container Sonata\AdminBundle\Builder\ORM\ShowBuilder
sonata.admin.form.extension.field container Sonata\AdminBundle\Form\Extension\Field\Type\FormTypeFieldExtension
sonata.admin.form.filter.type.choice container Sonata\AdminBundle\Form\Type\Filter\ChoiceType
sonata.admin.form.filter.type.default container Sonata\AdminBundle\Form\Type\Filter\DefaultType
sonata.admin.form.filter.type.number container Sonata\AdminBundle\Form\Type\Filter\NumberType
sonata.admin.form.type.admin container Sonata\AdminBundle\Form\Type\AdminType
sonata.admin.form.type.array container Sonata\AdminBundle\Form\Type\ImmutableArrayType
sonata.admin.form.type.boolean container Sonata\AdminBundle\Form\Type\BooleanType
sonata.admin.form.type.collection container Sonata\AdminBundle\Form\Type\CollectionType
sonata.admin.form.type.model container Sonata\AdminBundle\Form\Type\ModelType
sonata.admin.form.type.model_reference container Sonata\AdminBundle\Form\Type\ModelReferenceType
sonata.admin.guesser.orm_datagrid container Sonata\AdminBundle\Guesser\ORM\FilterTypeGuesser
sonata.admin.guesser.orm_datagrid_chain container Sonata\AdminBundle\Guesser\TypeGuesserChain
sonata.admin.guesser.orm_list container Sonata\AdminBundle\Guesser\ORM\TypeGuesser
sonata.admin.guesser.orm_list_chain container Sonata\AdminBundle\Guesser\TypeGuesserChain
sonata.admin.guesser.orm_show container Sonata\AdminBundle\Guesser\ORM\TypeGuesser
sonata.admin.guesser.orm_show_chain container Sonata\AdminBundle\Guesser\TypeGuesserChain
sonata.admin.helper container Sonata\AdminBundle\Admin\AdminHelper
sonata.admin.manager.orm container Sonata\AdminBundle\Model\ORM\ModelManager
sonata.admin.orm.filter.type.boolean prototype Sonata\AdminBundle\Filter\ORM\BooleanFilter
sonata.admin.orm.filter.type.callback prototype Sonata\AdminBundle\Filter\ORM\CallbackFilter
sonata.admin.orm.filter.type.choice prototype Sonata\AdminBundle\Filter\ORM\ChoiceFilter
sonata.admin.orm.filter.type.model prototype Sonata\AdminBundle\Filter\ORM\ModelFilter
sonata.admin.orm.filter.type.number prototype Sonata\AdminBundle\Filter\ORM\NumberFilter
sonata.admin.orm.filter.type.string prototype Sonata\AdminBundle\Filter\ORM\StringFilter
sonata.admin.pool container Sonata\AdminBundle\Admin\Pool
sonata.admin.route_loader container Sonata\AdminBundle\Route\AdminPoolLoader
sonata.admin.security.handler n/a alias for sonata.admin.security.handler.acl
sonata.admin.security.handler.acl container Sonata\AdminBundle\Security\Handler\AclSecurityHandler
sonata.admin.security.handler.noop container Sonata\AdminBundle\Security\Handler\NoopSecurityHandler
sonata.admin.twig.extension container Sonata\AdminBundle\Twig\Extension\SonataAdminExtension
sonata.admin.validator.inline container Sonata\AdminBundle\Validator\InlineValidator
sonata.user.admin.group prototype Sonata\UserBundle\Admin\Entity\GroupAdmin
sonata.user.admin.user prototype Sonata\UserBundle\Admin\Entity\UserAdmin
vido.admin.admin.mediacategories prototype Vido\AdminBundle\Admin\NewsCategoryAdmin
vido.admin.admin.medias prototype Vido\AdminBundle\Admin\MediaAdmin
vido.admin.admin.news prototype Vido\AdminBundle\Admin\NewsAdmin
vido.admin.admin.vendors prototype Vido\AdminBundle\Admin\VendorAdmin
vido.admin.admin.video prototype Vido\AdminBundle\Admin\VideoAdmin
vido.admin.admin.warecategories prototype Vido\AdminBundle\Admin\WareCategoryAdmin

security.yml

parameters:
security.acl.permission.map.class: Sonata\AdminBundle\Security\Acl\Permission\AdminPermissionMap
security:
providers:
fos_userbundle:
id: fos_user.user_manager

firewalls:
main:
pattern: ^/
form_login:
provider: fos_userbundle
login_path: /login
use_forward: false
check_path: /login_check
failure_path: null
logout: true
anonymous: true

access_control:
# The WDT has to be allowed to anonymous users to avoid requiring the login with the AJAX request
- { path: ^/wdt/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/profiler/, role: IS_AUTHENTICATED_ANONYMOUSLY }

# AsseticBundle paths used when using the controller for assets
- { path: ^/js/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/css/, role: IS_AUTHENTICATED_ANONYMOUSLY }

# URL of FOSUserBundle which need to be available to anonymous users
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY } # for the case of a failed login
- { path: ^/user/new$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/check-confirmation-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/confirm/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/confirmed$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/request-reset-password$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/send-resetting-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/check-resetting-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/reset-password/, role: IS_AUTHENTICATED_ANONYMOUSLY }

# Secured part of the site
# This config requires being logged for the whole site and having the admin role for the admin part.
# Change these rules to adapt them to your needs
- { path: ^/admin/, role: ROLE_ADMIN }
- { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }

role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_SONATA_ADMIN, ROLE_ALLOWED_TO_SWITCH]

acl:
connection: default

fos_user.yml

fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb'
firewall_name: main
user_class: Vido\CoreBundle\Entity\User
group:
group_class: Vido\CoreBundle\Entity\Group

As far as I see, I have incorrect values for the sonata.user.admin.group and sonata.user.admin.user
Not sure how I can set them to Vido\CoreBundle\Entity\User Vido\CoreBundle\Entity\Group

Any suggestions?