getgrav/grav · error · SecurityNotAllowedPropertyError

Calling "%s" property on a "%s" object is not allowed.

Error message

Calling "%s" property on a "%s" object is not allowed.

What it means

Error "Calling "%s" property on a "%s" object is not allowed." thrown in getgrav/grav.

Source

Thrown at system/src/Grav/Common/Twig/Sandbox/GravSecurityPolicy.php:130

            if ($obj instanceof $class) {
                return true;
            }
        }

        return false;
    }

    public function checkPropertyAllowed($obj, $property): void
    {
        foreach ($this->allowedProperties as $class => $properties) {
            $props = is_array($properties) ? $properties : [$properties];
            if ($obj instanceof $class && (in_array('*', $props, true) || in_array($property, $props, true))) {
                return;
            }
        }

        $class = $obj::class;
        throw new SecurityNotAllowedPropertyError(
            sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, $class),
            $class,
            $property
        );
    }
}

View on GitHub (pinned to 6040efed04)

When it happens

Trigger: Thrown at system/src/Grav/Common/Twig/Sandbox/GravSecurityPolicy.php:130 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17). Data as JSON: /api/errors/7bc86b2c012dde1b. Report an issue: GitHub.