티스토리 뷰

코드에서 내 대답을 찾았습니다. 파일 : src / Sylius / Bundle / WebBundle / Menu / BackendMenuBuilder.php

이 파일은 해당 사용자가 볼 수 있도록 허용하는지 확인한 후 관리자 메뉴 사이드 바에 모든 항목을 배치하는 파일입니다. 여기에 다음과 같은 코드 덩어리가 있습니다.

if ($this->rbacAuthorizationChecker->isGranted('sylius.product.index')) { // THIS IS IT!
        $child->addChild('products', [
                    'route' => 'sylius_backend_product_index',
                                'labelAttributes' => ['icon' => 'glyphicon glyphicon-th-list'],
                                        ])->setLabel($this->translate(sprintf('sylius.backend.menu.%s.products', $section)));
                                                $child->addChild('inventory', [
                                                            'route' => 'sylius_backend_inventory_index',
                                                                        'labelAttributes' => ['icon' => 'glyphicon glyphicon-tasks'],
                                                                                ])->setLabel($this->translate(sprintf('sylius.backend.menu.%s.stockables', $section)));
                                                                                    }
                                                                                    

이렇게하면 제품 메뉴 항목이 추가되고 동일한 권한 인 'sylius.product.index'에 따라 인벤토리 메뉴 항목도 동시에 추가됩니다. 아직 자체 권한으로 분리되지 않았거나 대부분의 경우 제품을 관리 할 수있는 사용자도 재고를 관리 할 수 ​​있어야한다고 생각합니다. 내 문제를 해결하기 위해 새 권한을 만들 것입니다.



출처
https://stackoverflow.com/questions/39940006
댓글
공지사항
Total
Today
Yesterday
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31