diff --git a/tests/test_api_v10.py b/tests/test_api_v10.py index f08db8b9..7c280cd6 100644 --- a/tests/test_api_v10.py +++ b/tests/test_api_v10.py @@ -886,7 +886,7 @@ def test_permissions_endpoint(client): "maintainers": ["alice@example.com"], "_testcase_regex_pattern": "^kernel-qe", "groups": ["devel", "qa"], - "users": ["alice@example.com"], + "users": ["alice", "bob"], }, { "name": "Greenwave Tests", @@ -927,6 +927,12 @@ def test_permissions_endpoint(client): assert f"{config['PERMISSIONS'][0]['name']}" not in r.text assert f"{config['PERMISSIONS'][1]['name']}" in r.text + r = client.get('/api/v1.0/permissions?testcase=kernel-qe.test1&html=1') + assert r.status_code == 200 + assert r.content_type.startswith('text/html') + assert "" in r.text + assert "" in r.text + def test_config_endpoint_superusers(client): config = { diff --git a/waiverdb/templates/permissions.html b/waiverdb/templates/permissions.html index 07e99607..3c85b40c 100644 --- a/waiverdb/templates/permissions.html +++ b/waiverdb/templates/permissions.html @@ -14,28 +14,31 @@ Name Maintainers Testcases - Users/Groups + Groups + Users + Description {% for p in permissions -%} {{ p["name"] }} - {{ p["maintainers"] | map("urlize") | join(" ") | safe }} - {{ p["testcases"] | join("
") | replace('-', '‑') | safe }} - - {% if p["groups"] | length > 0 -%} - Groups:
- {{ p["groups"] | join("
") | replace('-', '‑') | safe }} - {% if p["users"] | length > 0 -%} -
- {%- endif %} - {%- endif %} - {% if p["users"] | length > 0 -%} - Users:
- {{ p["users"] | join("
") | replace('-', '‑') | safe }} - {%- endif %} - + + + + + {{ p["description"] }} {%- endfor %}