<dtml-var manage_page_header>

<dtml-with "_(management_view='Security')">
  <dtml-if manage_tabs>
    <dtml-var manage_tabs>
  </dtml-if manage_tabs>
</dtml-with>

<main class="container-fluid">

  <p class="form-text">
    Roles assigned to the permission <strong>&dtml-permission_to_manage;</strong>
  </p>

  <form action="manage_permission" method="post">
    <input type="hidden" name="permission_to_manage"
           value="&dtml-permission_to_manage;" />

    <table class="table table-striped table-hover table-sm">
      <dtml-in expr="rolesOfPermission(permission_to_manage)" mapping=1>
        <tr>
          <td class="zmi-object-check text-right">
            <input type="checkbox" name="roles:list" value="&dtml-name;"
                   <dtml-if selected>checked</dtml-if>>
          </td>
          <td class="zmi-object-id">&dtml-name;</td>
        </tr>
      </dtml-in>
    </table>

    <dtml-unless isTopLevelPrincipiaApplicationObject>
      <div class="form-check">
        <input type="checkbox" class="form-check-input" name="acquire"
               id="acquire"
               <dtml-var expr="acquiredRolesAreUsedBy(permission_to_manage)">/>
        <label for="acquire" class="form-check-label">
          Also use roles acquired from folders containing this objects
        </label>
      </div>
    </dtml-unless>

    <div class="zmi-controls">
      <input class="btn btn-primary" type="submit" name="submit"
             value="Save Changes" />
    </div>

  </form>

</main>

<dtml-var manage_page_footer>
