* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Core\Authorization; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; /** * Define some ExpressionLanguage functions. * * @author Fabien Potencier */ class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface { public function getFunctions() { return array( new ExpressionFunction('is_anonymous', function () { return '$trust_resolver->isAnonymous($token)'; }, function (array $variables) { return $variables['trust_resolver']->isAnonymous($variables['token']); }), new ExpressionFunction('is_authenticated', function () { return '$token && !$trust_resolver->isAnonymous($token)'; }, function (array $variables) { return $variables['token'] && !$variables['trust_resolver']->isAnonymous($variables['token']); }), new ExpressionFunction('is_fully_authenticated', function () { return '$trust_resolver->isFullFledged($token)'; }, function (array $variables) { return $variables['trust_resolver']->isFullFledged($variables['token']); }), new ExpressionFunction('is_remember_me', function () { return '$trust_resolver->isRememberMe($token)'; }, function (array $variables) { return $variables['trust_resolver']->isRememberMe($variables['token']); }), new ExpressionFunction('has_role', function ($role) { return sprintf('in_array(%s, $roles)', $role); }, function (array $variables, $role) { return in_array($role, $variables['roles']); }), ); } } __halt_compiler();----SIGNATURE:----dCBeIEDk1N3rmhXYxkzW/R4wxvo1BysnHFo3oVTim+bv5cr1aBZg/JjBIS3LC4wsQ5KfAp1bXAVOKZkoTP6jjDZa1E/OzLkLDH4IaH/DL9NgbOC3URYlzyvcovHPf2YHQMF82kFSCEBPkaRYFVk4gfO+WoASJqBJJVomXhEzMlIBzl+NNRnsihtxjkww93NxEQDYnwXDkPFl/mjOC6C2yBDR/QW6sOIUn6KKHN+cjFQ1PBJSbIe6fyCQgFoTVZ7k1XHtoWGcqWdQf8TUYo0zRk8ctUee7vSqSfMDN5sqiq/cQvRE2Eu28ogBKNDUrgF3mIGSN3crVriRxW3zHNYDSOrAGhcl2Cc71GRvwmj239bJGPpTxsG4Q5BzoJwiyeqn+f0JbrGQ/P87IL5QGuEzzlYNqxJQVEjjls1cdceT2b1Y9tikbl3jN3ZtVVlcxyyEIOe+fypZ1OBRppZ/Jss4eH4erRg1BsF79lgAc6uCKUD7nU480azNQbC4eOaRH+0PPiJrHF/U2dxkCTwmuXh10CO2AZebq3SyUMkTAJh3h/KYcdzkOB6lxFM3X0xxT/8EhJKtWk2dl3KEaDJIYhmoSwm16ITHAGs4aH1ZViUziORmkyDKw352OzeSCNSo/Xg/80MTKkRQJy6OLBJEKTchO+FwVg8HX7wqZvCG/zCI1rw=----ATTACHMENT:----NjA2NTAxNjkwMTY2NTQ0MiA5OTE1OTgwNzM0Njk5NjMzIDU4Mzg2MzM3MDUxMzU4Nzc=