protected function validateAccessSettings()
    {
        $field = 'access';
        $rules = $this->getSubmitted($field);

        $errors = $converted = array();
        foreach (gplcart_string_explode_multiline($rules) as $line => $rule) {

            $line++;

            $parts = gplcart_string_explode_whitespace($rule, 2);

            if (count($parts) != 2) {
                $errors[] = $line;
                continue;
            }

            list($role_id, $pattern) = $parts;

            if (strlen(trim($pattern, '\\/')) != strlen($pattern)) {
                $errors[] = $line;
            }

            if (!$this->isValidRoleSettings($role_id)) {
                $errors[] = $line;
                continue;
            }

            $normalized_pattern = gplcart_path_normalize($pattern);

            if (!gplcart_string_is_regexp($normalized_pattern) || strlen($normalized_pattern) > 250) {
                $errors[] = $line;
                continue;
            }

            $converted[$role_id][] = $normalized_pattern;
        }

        if (!empty($errors)) {
            $error = $this->translation->text('Error on line @num', array('@num' => implode(',', $errors)));
            $this->setError($field, $error);
            return false;
        }

        $this->setSubmitted($field, $converted);
        return true;
    }