public function process(&$request)
    {
        $authorize = $this->deny;
        assert('is_array($request)');
        assert('array_key_exists("Attributes", $request)');

        $attributes =& $request['Attributes'];

        foreach ($this->valid_attribute_values as $name => $patterns) {
            if (array_key_exists($name, $attributes)) {
                foreach ($patterns as $pattern) {
                    $values = $attributes[$name];
                    if (!is_array($values)) {
                        $values = array($values);
                    }
                    foreach ($values as $value) {
                        if ($this->regex) {
                            $matched = preg_match($pattern, $value);
                        } else {
                            $matched = ($value == $pattern);
                        }
                        if ($matched) {
                            $authorize = ($this->deny ? false : true);
                            break 3;
                        }
                    }
                }
            }
        }
        if (!$authorize) {
            $this->unauthorized($request);
        }
    }
public function process(&$request)
    {
        $authorize = $this->deny;
        assert('is_array($request)');
        assert('array_key_exists("Attributes", $request)');

        $attributes =& $request['Attributes'];

        foreach ($this->valid_attribute_values as $name => $patterns) {
            if (array_key_exists($name, $attributes)) {
                foreach ($patterns as $pattern) {
                    $values = $attributes[$name];
                    if (!is_array($values)) {
                        $values = array($values);
                    }
                    foreach ($values as $value) {
                        if ($this->regex) {
                            $matched = preg_match($pattern, $value);
                        } else {
                            $matched = ($value == $pattern);
                        }
                        if ($matched) {
                            $authorize = ($this->deny ? false : true);
                            break 3;
                        }
                    }
                }
            }
        }
        if (!$authorize) {
            $this->unauthorized($request);
        }
    }
public function process ( & $ request ) { $ authorize = $ this -> deny ; assert ( 'is_array($request)' ) ; assert ( 'array_key_exists("Attributes", $request)' ) ; $ attributes = & $ request [ 'Attributes' ] ; foreach ( $ this -> valid_attribute_values as $ name => $ patterns ) { if ( array_key_exists ( $ name , $ attributes ) ) { foreach ( $ patterns as $ pattern ) { $ values = $ attributes [ $ name ] ; if ( ! is_array ( $ values ) ) { $ values = array ( $ values ) ; } foreach ( $ values as $ value ) { if ( $ this -> regex ) { $ matched = preg_match ( $ pattern , $ value ) ; } else { $ matched = ( $ value == $ pattern ) ; } if ( $ matched ) { $ authorize = ( $ this -> deny ? false : true ) ; break 3 ; } } } } } if ( ! $ authorize ) { $ this -> unauthorized ( $ request ) ; } }
Apply filter to validate attributes.

@param array &$request The current request
Apply filter to validate attributes .