Skip to content

Instantly share code, notes, and snippets.

View gbelmm's full-sized avatar

gbelmm

View GitHub Profile
@gbelmm
gbelmm / AclFilter.php
Created December 11, 2015 01:47 — forked from rejsmont/AclFilter.php
ACL filter for Doctrine QueryBuilder and Query. Supports multiple filters applied to a single query, entity inheritance and role hierarchies.
<?php
/*
* Copyright 2013 Radoslaw Kamil Ejsmont <radoslaw@ejsmont.net>
*
* Original code by mailaneel is available at
* https://gist.github.com/mailaneel/1363377
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@gbelmm
gbelmm / LoginSuccessHandler.php
Created November 18, 2015 03:02 — forked from marydn/LoginSuccessHandler.php
Custom URL redirect by role after success login on Symfony 2 using a service listener without FOSUser Bundle.
# src/Acme/DemoBundle/Security/Authentication/Handler/LoginSuccessHandler.php
<?php
namespace Acme\DemoBundle\Security\Authentication\Handler;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Router;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\SecurityContext;