{% macro create(optionName, permission, inputId) %}

    {% set inline = getMetadata(optionName, 'INLINE')|join(' ') %}
    {% set description = getMetadata(optionName, 'DESCRIPTION') %}
    {% set angularAttributes = getMetadata(optionName, 'ANGULAR_ATTRIBUTES') %}
    {% set newNetwork = isOnNetworkDashboard() %}

    {% if permission == 2 or permission == 1 %}
        {% set  disabled = "disabled" %}
    {% else %}
        {% set disabled = "" %}
    {% endif %}

    {% if not angularAttributes is empty %}
        {% if  newNetwork  %}
            {% set angularAttributes = angularAttributes ~ ' && (0))"' %}
        {% else %}
            {% set angularAttributes = angularAttributes ~ '&& (1))"' %}
        {% endif %}
    {% endif %}

    <fieldset>
        <label class="adi-align-checkbox-label" for="{{ inputId }}">
            <input class="adi-align-checkbox-input" id="{{ inputId }}" type="checkbox"  {{ inline }} {{ angularAttributes|raw }} ng-model="option.{{ optionName }}" ng-class="{ error: messages.{{ optionName }} != null }" {{ disabled }}>

            {% import "option/element/description.twig" as descriptionElement %}
            {{ descriptionElement.create(description) }}
        </label>
    </fieldset>

{% endmacro %}