|
78 | 78 | <dd>{{ command_data_obj.since }}</dd>
|
79 | 79 | <dl>
|
80 | 80 | {% endif %}
|
81 |
| - {% if command_data_obj.acl_categories %} |
| 81 | + {% if command_data_obj.acl_categories or command_data_obj.command_flags %} |
82 | 82 | <dl>
|
83 | 83 | <dt>ACL Categories:</dt>
|
84 |
| - <dd> |
85 |
| - {% for category in command_data_obj.acl_categories %} |
86 |
| - @{{ category|lower }}{% if not loop.last %}, {% endif %} |
| 84 | + <dd> |
| 85 | + {% set all_categories = [] %} |
| 86 | + |
| 87 | + {% if command_data_obj.acl_categories %} |
| 88 | + {% set all_categories = command_data_obj.acl_categories %} |
| 89 | + {% endif %} |
| 90 | + |
| 91 | + {% if command_data_obj.command_flags %} |
| 92 | + {# Command flag WRITE implies ACL category WRITE #} |
| 93 | + {% if "WRITE" in command_data_obj.command_flags %} |
| 94 | + {% set all_categories = all_categories | concat(with="WRITE") %} |
| 95 | + {% endif %} |
| 96 | + |
| 97 | + {# Command flag READONLY and not ACL category SCRIPTING implies ACL category READ #} |
| 98 | + {% if "READONLY" in command_data_obj.command_flags and (not command_data_obj.acl_categories or not "SCRIPTING" in command_data_obj.acl_categories) %} |
| 99 | + {% set all_categories = all_categories | concat(with="READ") %} |
| 100 | + {% endif %} |
| 101 | + |
| 102 | + {# Command flag ADMIN implies ACL categories ADMIN and DANGEROUS #} |
| 103 | + {% if "ADMIN" in command_data_obj.command_flags %} |
| 104 | + {% set all_categories = all_categories | concat(with="ADMIN") | concat(with="DANGEROUS") %} |
| 105 | + {% endif %} |
| 106 | + |
| 107 | + {% if "FAST" in command_data_obj.command_flags %} |
| 108 | + {% set all_categories = all_categories | concat(with="FAST") %} |
| 109 | + {% endif %} |
| 110 | + |
| 111 | + {# Command flag PUBSUB implies ACL category PUBSUB #} |
| 112 | + {% if "PUBSUB" in command_data_obj.command_flags %} |
| 113 | + {% set all_categories = all_categories | concat(with="PUBSUB") %} |
| 114 | + {% endif %} |
| 115 | + |
| 116 | + {# Command flag BLOCKING implies ACL category BLOCKING #} |
| 117 | + {% if "BLOCKING" in command_data_obj.command_flags %} |
| 118 | + {% set all_categories = all_categories | concat(with="BLOCKING") %} |
| 119 | + {% endif %} |
| 120 | + {% endif %} |
| 121 | + |
| 122 | + {# Not ACL category FAST implies ACL category SLOW. "If it's not fast, it's slow." #} |
| 123 | + {% if "FAST" not in all_categories %} |
| 124 | + {% set all_categories = all_categories | concat(with="SLOW") %} |
| 125 | + {% endif %} |
| 126 | + |
| 127 | + {% for category in all_categories %} |
| 128 | + @{{ category|lower }}{% if not loop.last %}, {% endif %} |
87 | 129 | {% endfor %}
|
88 | 130 | </dd>
|
89 | 131 | <dl>
|
|
0 commit comments