Skip to content
Browse files

renamed 'role' to 'unless_role', added some info to the README

  • Loading branch information...
1 parent bffc9fa commit 1680a743d57b1c744c37374e3d6e73c7af568c9c @lsmith77 lsmith77 committed Oct 30, 2012
Showing with 5 additions and 3 deletions.
  1. +1 −1 DependencyInjection/Configuration.php
  2. +2 −2 EventListener/CacheControlListener.php
  3. +2 −0 README.md
View
2 DependencyInjection/Configuration.php
@@ -47,7 +47,7 @@ private function addRulesSection(ArrayNodeDefinition $rootNode)
->arrayNode('rules')
->prototype('array')
->children()
- ->scalarNode('role')->defaultNull()->end()
+ ->scalarNode('unless_role')->defaultNull()->end()
->scalarNode('path')->defaultNull()->end()
->scalarNode('domain')->defaultNull()->end()
->scalarNode('reverse_proxy_ttl')->defaultNull()->end()
View
4 EventListener/CacheControlListener.php
@@ -125,9 +125,9 @@ protected function setExtraControls(Response $response, array $controls)
protected function getOptions(Request $request)
{
foreach ($this->map as $elements) {
- if (!empty($elements[1]['role'])
+ if (!empty($elements[1]['unless_role'])
&& $this->securityContext
- && $this->securityContext->isGranted($elements[1]['role'])
+ && $this->securityContext->isGranted($elements[1]['unless_role'])
) {
continue;
}
View
2 README.md
@@ -104,6 +104,8 @@ If you just want to match the homepage you need to use the path ```^/$```.
To match pages URLs with caching rules, this bundle uses the class ```Symfony\Component\HttpFoundation\RequestMatcher```.
+The ``unless_role`` makes it possible to skip rules based on if the current authenticated user has been granted the provided role.
+
Custom Varnish Parameters
------------------------

0 comments on commit 1680a74

Please sign in to comment.
Something went wrong with that request. Please try again.