1. Go to this page and download the library: Download sylius/rbac-plugin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Doctrine\ORM\Mapping\MappedSuperclass;
use Doctrine\ORM\Mapping\Table;
use Sylius\Component\Core\Model\AdminUser as BaseAdminUser;
use Sylius\RbacPlugin\Entity\AdministrationRoleAwareInterface;
use Sylius\RbacPlugin\Entity\AdministrationRoleAwareTrait;
/**
* @MappedSuperclass
* @Table(name="sylius_admin_user")
*/
class AdminUser extends BaseAdminUser implements AdministrationRoleAwareInterface
{
use AdministrationRoleAwareTrait;
}
public function isAdminRoute(string $routeName): bool
{
return
strpos($routeName, 'sylius_admin') !== false ||
strpos($routeName, 'sylius_rbac_admin') !== false
;
}