protected function isAllowedContext($dataDefinition, $propertyName, $model)
    {
        // Check the name of the data def.
        if ('tl_metamodel_filtersetting' !== $dataDefinition->getName()) {
            return false;
        }

        // Check the name of the property.
        if ('attr_id2' !== $propertyName) {
            return false;
        }

        // Check the type.
        $property = $model->getProperty('type');
        return !('range' !== $property && 'rangedate' !== $property);
    }