<h4>Permissions sur les utilisateurs</h4>
<form method="POST" action="{{ route('structure.update', $structure->id) }}">
    @csrf
    {{ method_field('PUT') }}

    <input name="type_permission" type="hidden" value="utilisateur">
    <table class="table table-striped table-bordered">
        <thead>
        <tr>
            <th scope="col">Rôle</th>
            <th scope="col">Voir</th>
            <th scope="col">Ajouter</th>
            <th scope="col">Editer</th>
            <th scope="col">Supprimer</th>
        </tr>
        </thead>
        <tbody>
        @foreach($roles as $r)
            <tr>
                <td scope="row">{{ ROLE::ROLES_FORMATTED[$r->name] }}</td>
                <td><input type="checkbox" id="{{ $r->id }}-see_utilisateur" name="{{ $r->id }}-see_utilisateur" @if($r->hasPermissionTo('see_utilisateur')) checked @endif></td>
                <td><input type="checkbox" id="{{ $r->id }}-add_utilisateur" name="{{ $r->id }}-add_utilisateur" @if($r->hasPermissionTo('add_utilisateur')) checked @endif></td>
                <td><input type="checkbox" id="{{ $r->id }}-edit_utilisateur" name="{{ $r->id }}-edit_utilisateur" @if($r->hasPermissionTo('edit_utilisateur')) checked @endif></td>
                <td><input type="checkbox" id="{{ $r->id }}-delete_utilisateur" name="{{ $r->id }}-delete_utilisateur" @if($r->hasPermissionTo('delete_utilisateur')) checked @endif></td>
            </tr>
        @endforeach
        </tbody>
    </table>

    <div class="form-group row mb-0 float-right">
        <div class="col-md-8">
            <button type="submit" class="btn btn-outline-success">
                Sauvegarder
            </button>
        </div>
    </div>
</form>
