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);
        }
    }
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);
        }
    }
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 ) ; } }
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
Sets authorization per action . The action variable can be a string or array of strings