PHP code example of fighting-pie / symfony-rbac
1. Go to this page and download the library: Download fighting-pie/symfony-rbac 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/ */
fighting-pie / symfony-rbac example snippets
use SymfonyRbac\Services\RbacManager;
private $rbacManager;
public function __construct(RbacManager $rbacManager) {
$this->rbacManager = $rbacManager;
$userId = 31;
$permissionName = '/admin/user/31';
$res = $this->rbacManager->checkAccess($userId,$permissionName,[]);
}
bash
php composer.phar