original_string: public function action($actions, $function)
      {
          if (!is_array($actions)) {
              $actions = [$actions];
          }
  
  
          $controller = $this->_current['controller'];
  
          foreach ($actions as $action) {
              $path = $controller . '.' . $action;
  
              self::$_data = Hash::insert(self::$_data, $path, [
                          'function' => $function,
                          'roles' => [],
              ]);
  
              $this->_runFunction($action);
          }
      }
code: public function action($actions, $function)
      {
          if (!is_array($actions)) {
              $actions = [$actions];
          }
  
  
          $controller = $this->_current['controller'];
  
          foreach ($actions as $action) {
              $path = $controller . '.' . $action;
  
              self::$_data = Hash::insert(self::$_data, $path, [
                          'function' => $function,
                          'roles' => [],
              ]);
  
              $this->_runFunction($action);
          }
      }
code_tokens: public function action ( $ actions , $ function ) { if ( ! is_array ( $ actions ) ) { $ actions = [ $ actions ] ; } $ controller = $ this -> _current [ 'controller' ] ; foreach ( $ actions as $ action ) { $ path = $ controller . '.' . $ action ; self :: $ _data = Hash :: insert ( self :: $ _data , $ path , [ 'function' => $ function , 'roles' => [ ] , ] ) ; $ this -> _runFunction ( $ action ) ; } }
docstring: Sets authorization per action.
  The action variable can be a string or array of strings
  
  ```
  $this->Authorizer->action(["My action"], function($auth) {
  // authorization for the chosen actions
  });
  ```
  
  @param string|array $actions An array or string to run the function on.
  @param callable $function Function to authorize with.
  @return void
docstring_tokens: Sets authorization per action . The action variable can be a string or array of strings