<dtml-var manage_page_header>

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

<main class="container-fluid">

  <h3>Local roles for user <strong>&dtml-userid;</strong></h3>
  <p class="form-help">
    Local roles allow you to give particular users extra roles in the 
    context of this object, in addition to the roles they already have. 
    <br />
    To change the local roles for this user, select the extra roles this 
    user should have in the context of this object and click the
    <em>Save Changes</em> button.
  </p>

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

    <table class="table table-striped table-hover table-sm">
      <dtml-with "_(user_roles=get_local_roles_for_userid(userid))">
        <dtml-in valid_roles>
          <dtml-if "_vars['sequence-item'] not in ('Anonymous','Shared',
                                                   'Authenticated')">
            <tr>
              <td class="zmi-object-check text-right">
                <input type="checkbox" name="roles:list"
                       id="&dtml-sequence-item;"
                       value="&dtml-sequence-item;"
                       <dtml-if "_['sequence-item'] in user_roles">
                         checked
                       </dtml-if>/>
              </td>
              <td>&dtml-sequence-item;</td>
            </tr>
          </dtml-if>
        </dtml-in>
      </dtml-with>
    </table>

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

  </form>

</main>

<dtml-var manage_page_footer>
