1. Go to this page and download the library: Download app-verk/user-bundle 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/ */
app-verk / user-bundle example snippets
// ./src/AppBundle/Controller/DefaultController.php
...
use AppVerk\UserBundle\Annotation\AVSecurity;
...
/**
* ...
* @AVSecurity(allow={"ROLE_ADMIN"}, disallow={"ROLE_X"}, name="list", group="default")
*/
public function listAction()
{
return $this->render('@App/controller/user/list.html.twig');
}
// ./src/AppBundle/Security/CustomAccessResolver.php
...
use AppVerk\UserBundle\Security\AccessResolverInterface;
...
class SimpleAccessResolver implements AccessResolverInterface
{
public function resolve(RoleableInterface $user, $action): bool
{
// your own logic
}
}
namespace AppBundle\Entity;
use AppVerk\UserBundle\Entity\User as AbstractUser;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @ORM\Entity(repositoryClass="AppBundle\Repository\UserRepository")
*/
class User extends AbstractUser implements EntityInterface
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.