Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 2 additions & 44 deletions templates/command-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,53 +102,11 @@ <h1 class="page-title">{{ command_title }} {% if deprecated %}<small> {{ depreca
<dd>{{ command_data_obj.since }}</dd>
<dl>
{% endif %}
{% if command_data_obj.acl_categories or command_data_obj.command_flags %}
{% if command_data_obj.acl_categories %}
<dl>
<dt>ACL Categories:</dt>
<dd>
{% set all_categories = [] %}

{% if command_data_obj.acl_categories %}
{% set all_categories = command_data_obj.acl_categories %}
{% endif %}

{% if command_data_obj.command_flags %}
{# Command flag WRITE implies ACL category WRITE #}
{% if "WRITE" in command_data_obj.command_flags %}
{% set all_categories = all_categories | concat(with="WRITE") %}
{% endif %}

{# Command flag READONLY and not ACL category SCRIPTING implies ACL category READ #}
{% if "READONLY" in command_data_obj.command_flags and (not command_data_obj.acl_categories or not "SCRIPTING" in command_data_obj.acl_categories) %}
{% set all_categories = all_categories | concat(with="READ") %}
{% endif %}

{# Command flag ADMIN implies ACL categories ADMIN and DANGEROUS #}
{% if "ADMIN" in command_data_obj.command_flags %}
{% set all_categories = all_categories | concat(with="ADMIN") | concat(with="DANGEROUS") %}
{% endif %}

{% if "FAST" in command_data_obj.command_flags %}
{% set all_categories = all_categories | concat(with="FAST") %}
{% endif %}

{# Command flag PUBSUB implies ACL category PUBSUB #}
{% if "PUBSUB" in command_data_obj.command_flags %}
{% set all_categories = all_categories | concat(with="PUBSUB") %}
{% endif %}

{# Command flag BLOCKING implies ACL category BLOCKING #}
{% if "BLOCKING" in command_data_obj.command_flags %}
{% set all_categories = all_categories | concat(with="BLOCKING") %}
{% endif %}
{% endif %}

{# Not ACL category FAST implies ACL category SLOW. "If it's not fast, it's slow." #}
{% if "FAST" not in all_categories %}
{% set all_categories = all_categories | concat(with="SLOW") %}
{% endif %}

{% for category in all_categories %}
{% for category in command_data_obj.acl_categories %}
@{{ category|lower }}{% if not loop.last %}, {% endif %}
{% endfor %}
</dd>
Expand Down