PHP code example of arobases / sylius-rights-management-plugin

1. Go to this page and download the library: Download arobases/sylius-rights-management-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/ */

    

arobases / sylius-rights-management-plugin example snippets


//src/Entity/AdminUser.php



declare(strict_types=1);

namespace App\Entity\User;

use Arobases\SyliusRightsManagementPlugin\Entity\AdminUserInterface;
use Doctrine\ORM\Mapping as ORM;
use Arobases\SyliusRightsManagementPlugin\Entity\AdminUserTrait;
use Sylius\Component\Core\Model\AdminUser as BaseAdminUser;

/**
 * @ORM\Entity
 * @ORM\Table(name="sylius_admin_user")
 */
class AdminUser extends BaseAdminUser implements AdminUserInterface
{
    use AdminUserTrait;
}

bash
# config/bundles.php


return [
...
  Arobases\SyliusRightsManagementPlugin\ArobasesSyliusRightsManagementPlugin::class => ['all' => true],
...
];
html.twig
 {# templates/bundles/SyliusAdminBundle/AdminUser/Form/_generalInfoExtended.html.twig #}
    ...
    <div class="ui segment">
       <h4 class="ui dividing header">{{ 'arobases_sylius_rights_management_plugin.ui.choice_role'|trans }}</h4>
       {{ form_row(form.role) }}
    </div>
    ...

php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate