<%# The permission picker, shared by the user-edit and group-detail pages. A fieldset of checkboxes — one per permission the installed plugins declare — ticked where this user/group holds it. The whole set posts back, so what is submitted IS the desired set of *direct* grants (see admin-grants.ts). Two rows never post, by design: an `inherited` one (the grant comes from a group, so it is changed there) and every row when `readOnly` (the viewer holds :read but not :write). Neither can be diffed into an accidental revoke, because grantDiff compares against the direct grants only. Locals: csrfToken, permissions ({ action, choices, empty, error, field, hint, inheritedNote, legend, readOnly, submit }). %>

<%= permissions.legend %>

<% if (permissions.error) { -%> <%- include("partials/alert", { text: permissions.error, tone: "neg" }) %> <% } -%> <% if (permissions.empty) { -%>

<%= permissions.empty %>

<% } else { -%>

<%= permissions.hint %>

<% if (permissions.readOnly) { -%>
<%= permissions.legend %> <% permissions.choices.forEach((c) => { -%> <% }) -%>
<% } else { -%>
<%= permissions.legend %> <% permissions.choices.forEach((c) => { -%> <% }) -%>
<% } -%> <% if (permissions.inheritedNote) { -%>

<%= permissions.inheritedNote %>

<% } -%> <% if (permissions.pending) { -%>

<%= permissions.pending %>

<% } -%> <% } -%>