2014-07-05 43 views
0

我有一個關於配置Symfony 2.5和Sonata管理軟件包的問題。我試圖修復它[在google.com上搜索,仔細閱讀sonata-project.org],但問題仍然出現。所以我希望每個人都會支持我解決它。Symfony2和Sonata管理軟件包的問題 - 儀表板登錄區

請參考下面我配置了什麼細節:

奏鳴曲/ sonata_admin.yml的security.yml

parameters: 
     security.acl.permission.map.class: Sonata\AdminBundle\Security\Acl\Permission\AdminPermissionMap 

    security: 
     encoders: 
      FOS\UserBundle\Model\UserInterface: sha512 

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

      SONATA: 
       # if you are not using acl then this line must be uncommented 
       - ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT 
       #- ROLE_SONATA_PAGE_ADMIN_BLOCK_EDIT 

     providers: 
      fos_userbundle: 
       id: fos_user.user_manager 

     firewalls: 
      # Disabling the security for the web debug toolbar, the profiler and Assetic. 
      dev: 
       pattern: ^/(_(profiler|wdt)|css|images|js|admin/_(wdt|profiler)|api/_(wdt|profiler))/ 
       security: false 

      # This firewall is used to handle the admin login area 
      # This part is handled by the Sonata User Bundle 
      admin: 
       pattern:   /admin(.*) 
       context:   user 
       form_login: 
        provider:  fos_userbundle 
        login_path:  /admin/login 
        use_forward: false 
        check_path:  /admin/login_check 
        default_target_path: /admin/dashboard 
        failure_path: null 
        always_use_default_target_path: true 
       logout: 
        path:   /admin/logout 
        target:   /admin/login 
       anonymous: true 
      # This firewall is used to handle the public login area 
      # This part is handled by the FOS User Bundle 

     access_control: 

      # Admin login page needs to be access without credential 
      - { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } 
      - { path: ^/admin/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY } 
      - { path: ^/admin/login-check$, 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. 
      # It also secures the shop checkout process 
      # Change these rules to adapt them to your needs 
      - { path: ^/admin, role: [ROLE_ADMIN, ROLE_SONATA_ADMIN] } 
      - { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY } 

     acl: 
      connection: default 

配置的配置[這個文件是在config.yml被列入]

sonata_admin: 
     security: 
       handler: sonata.admin.security.handler.acl 
       # acl security information 
       information: 
        GUEST: [VIEW, LIST] 
        STAFF: [EDIT, LIST, CREATE] 
        EDITOR: [OPERATOR, EXPORT] 
        ADMIN: [MASTER] 
       # permissions not related to an object instance and also to be available when objects do not exist 
       # the DELETE admin permission means the user is allowed to batch delete objects 
       admin_permissions: [CREATE, LIST, DELETE, UNDELETE, EXPORT, OPERATOR, MASTER] 
       # permission related to the objects 
       object_permissions: [VIEW, EDIT, DELETE, UNDELETE, OPERATOR, MASTER, OWNER] 

     dashboard: 
      blocks: 
       - { position: left, type: sonata.block.service.text, settings: { content: "<div class='panel panel-default'><div class='panel-heading'><h3 class='panel-title'>Welcome!</h3></div><div class='panel-body'>You can customize this dashboard by editing the <code>sonata_admin.yml</code> file. The current dashboard presents the recent items from the NewsBundle and a non-statistical e-commerce information.</div></div>"} } 
       - { position: right, type: sonata.block.service.rss, settings: { title: Sonata Project's Feeds, url: http://sonata-project.org/blog/archive.rss, template: SonataAdminBundle:Block:block_rss_dashboard.html.twig }} 
      groups: 
       sonata.admin.group.administration: 
        label:   sonata_administration 
        label_catalogue: SonataAdminBundle 
        icon:   '<i class="fa fa-cogs"></i>' 
        items: 
         - sonata.user.admin.user 
         - sonata.user.admin.group 

配置奏鳴曲/ sonata_block.yml [此文件包含在config.yml中]

FOS的
sonata_block: 
     default_contexts: [cms] 

     blocks: 
      sonata.admin.block.admin_list: 
       contexts: [admin] 

      sonata.block.service.text: 
      sonata.block.service.rss: 

配置/ fos_user.yml [該文件是在config.yml被包括]

fos_user: 
    db_driver:  orm # can be orm or odm 
    firewall_name: main 

    # if you change the class configuration, please also alter the sonata_user.yml file 
    user_class:  Application\Sonata\UserBundle\Entity\User 

    group: 
     group_class: Application\Sonata\UserBundle\Entity\Group 

配置routing_admin.yml的routing.yml中

_admin: 
    resource: routing_admin.yml 
    prefix: /admin 

配置的[這個文件是包括在routing.yml]

admin: 
    resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml' 

_sonata_admin: 
    resource: . 
    type:  sonata_admin 

soanata_user_admin: 
    resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml' 

在composer.json中的一部分需求

"require": { 
     "php": ">=5.3.3", 
     "symfony/symfony": "2.5.*", 
     "doctrine/orm": "~2.2,>=2.2.3", 
     "doctrine/doctrine-bundle": "~1.2", 
     "twig/extensions": "~1.0", 
     "symfony/assetic-bundle": "~2.3", 
     "symfony/swiftmailer-bundle": "~2.3", 
     "symfony/monolog-bundle": "~2.4", 
     "sensio/distribution-bundle": "~3.0", 
     "sensio/framework-extra-bundle": "~3.0", 
     "incenteev/composer-parameter-handler": "~2.0", 
     "sonata-project/admin-bundle": "dev-master", 
     "sonata-project/doctrine-orm-admin-bundle": "dev-master", 
     "sonata-project/easy-extends-bundle": "dev-master", 
     "sonata-project/user-bundle": "[email protected] 

問題

的屏幕截圖,請訪問在:https://plus.google.com/u/0/110571324794293900613/posts/fHW9fz2sYHH?pid=6032630377545776242&oid=110571324794293900613

最後,我很感謝大家。

等待你的好消息!

感謝

回答

1

應覆蓋standard_layout.html.twig文件根據你的變化,使..

相關問題