Author: bshaffer
Date: 2010-02-13 16:10:43 +0100 (Sat, 13 Feb 2010)
New Revision: 28006

Modified:
   
plugins/csSecurityTaskExtraPlugin/branches/1.3/lib/task/sfAppRouteSecurityTask.class.php
Log:
allows optional argument for targeting a specific module

Modified: 
plugins/csSecurityTaskExtraPlugin/branches/1.3/lib/task/sfAppRouteSecurityTask.class.php
===================================================================
--- 
plugins/csSecurityTaskExtraPlugin/branches/1.3/lib/task/sfAppRouteSecurityTask.class.php
    2010-02-13 14:39:40 UTC (rev 28005)
+++ 
plugins/csSecurityTaskExtraPlugin/branches/1.3/lib/task/sfAppRouteSecurityTask.class.php
    2010-02-13 15:10:43 UTC (rev 28006)
@@ -6,6 +6,7 @@
   {
     $this->addArguments(array(
           new sfCommandArgument('application', sfCommandArgument::REQUIRED, 
'The application'),
+          new sfCommandArgument('module', sfCommandArgument::OPTIONAL, 'The 
module'),
         ));
         
     $this->addOptions(array(
@@ -53,7 +54,7 @@
       $module = $defaults['module'];
       $action = $defaults['action'];
       
-      if (isset($this->security[$module])) 
+      if (isset($this->security[$module]) && (!$arguments['module'] || 
$arguments['module'] == $module)) 
       {
         if (isset($this->security[$module][$action])) 
         {
@@ -86,7 +87,10 @@
     $this->log(sprintf($formatHeader, $this->formatter->format('Name', 
'COMMENT'), $this->formatter->format('Is Secure', 'COMMENT'), 
$this->formatter->format('Credentials', 'COMMENT')));
     foreach ($routeSecurity as $name => $policy)
     {
-      $this->log(sprintf($policy['is_secure'] ? $formatRow1 : $formatRow2, 
$name, $policy['is_secure_string'], $policy['credential_string']));
+      if (!$arguments['module'] || $arguments['module'] == $policy['module']) 
+      {
+        $this->log(sprintf($policy['is_secure'] ? $formatRow1 : $formatRow2, 
$name, $policy['is_secure_string'], $policy['credential_string']));
+      }
     }
   }
 

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to