sulu / ExampleNewsBundle

Sulu news example bundle
5 stars 3 forks source link

Add permissions tab to the backend #15

Open alexander-schranz opened 8 years ago

alexander-schranz commented 8 years ago
        if ($this->securityChecker->hasPermission(NewsAdmin::SECURITY_CONTEXT, 'security')) {
            $permissions = new ContentNavigationItem('Permissions');
            $permissions->setAction('permissions');
            $permissions->setDisplay(array('edit'));
            $permissions->setComponent('permission-tab@sulusecurity');
            $permissions->setPosition(50);
            $permissions->setComponentOptions(
                array(
                    'display' => 'form',
                    'type' => News::class,
                    'securityContext' => NewsAdmin::SECURITY_CONTEXT,
                )
            );

            $this->tabs[] = $permissions;
        }