$33 GRAYBYTE WORDPRESS FILE MANAGER $59

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/php54/usr/share/pear/Symfony/Bridge/Twig/Extension/

HOME
Current File : /opt/alt/php54/usr/share/pear/Symfony/Bridge/Twig/Extension//SecurityExtension.php
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Bridge\Twig\Extension;

use Symfony\Component\Security\Acl\Voter\FieldVote;
use Symfony\Component\Security\Core\SecurityContextInterface;

/**
 * SecurityExtension exposes security context features.
 *
 * @author Fabien Potencier <[email protected]>
 */
class SecurityExtension extends \Twig_Extension
{
    private $context;

    public function __construct(SecurityContextInterface $context = null)
    {
        $this->context = $context;
    }

    public function isGranted($role, $object = null, $field = null)
    {
        if (null === $this->context) {
            return false;
        }

        if (null !== $field) {
            $object = new FieldVote($object, $field);
        }

        return $this->context->isGranted($role, $object);
    }

    /**
     * {@inheritdoc}
     */
    public function getFunctions()
    {
        return array(
            new \Twig_SimpleFunction('is_granted', array($this, 'isGranted')),
        );
    }

    /**
     * Returns the name of the extension.
     *
     * @return string The extension name
     */
    public function getName()
    {
        return 'security';
    }
}


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.54 PM
root / root
0755
CodeExtension.php
7.925 KB
18 Dec 2019 11.22 AM
root / root
0644
ExpressionExtension.php
0.986 KB
18 Dec 2019 11.22 AM
root / root
0644
FormExtension.php
4.573 KB
18 Dec 2019 11.22 AM
root / root
0644
HttpKernelExtension.php
2.595 KB
18 Dec 2019 11.22 AM
root / root
0644
RoutingExtension.php
3.545 KB
18 Dec 2019 11.22 AM
root / root
0644
SecurityExtension.php
1.358 KB
18 Dec 2019 11.22 AM
root / root
0644
StopwatchExtension.php
1.106 KB
18 Dec 2019 11.22 AM
root / root
0644
TranslationExtension.php
3.245 KB
18 Dec 2019 11.22 AM
root / root
0644
YamlExtension.php
1.525 KB
18 Dec 2019 11.22 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF