{% macro buttons_create(roles) %} {% for endpoint in roles['create'] %} Create {% endfor %} {% endmacro %} {% macro buttons(roles, item, type_glyph={'read': 'search', 'update': 'edit', 'delete': 'trash-a'}) %} {% for type in ('read', 'update', 'delete') if type in roles %} {% for endpoint in roles[type] %} {% endfor %} {% endfor %} {% endmacro %}