Mojolicious-Plugin-Fondation-Perm-UI-Bootstrap
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Fondation/Perm/UI/Bootstrap.pm view on Meta::CPAN
->requires('fondation.perm' => 'perm_list')
->to(
controller => 'Perm',
action => 'index'
);
return $self;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Mojolicious::Plugin::Fondation::Perm::UI::Bootstrap - Web UI extension for Fondation::Perm â injects perm checkboxes into group forms
=head1 VERSION
version 0.02
=head1 SYNOPSIS
# myapp.conf
'Mojolicious::Plugin::Fondation::Perm::UI::Bootstrap' => {};
=head1 DESCRIPTION
Injects permission checkboxes into the group add/edit modal via Fondation
zones (C<group/add>). Provides C<loadPerms()> and C<collectPermAssignments()>
JavaScript functions consumed by C<DatatableGroup.js>.
=head1 ZONES
=head2 group/add
=over
=item C<html/group/add/perms.html.ep>
Bootstrap 5 checkboxes listing all available permissions, hidden by default,
shown by C<loadPerms()>.
=item C<js/group/add/perms.js.ep>
Two functions:
=over
=item C<loadPerms(group)>
Fetches all permissions via C<GET /api/perm>, renders checkboxes, and pre-checks
those the group already has (from C<group.perms>).
=item C<collectPermAssignments()>
Returns an array of checked permission IDs â called by C<validateGroupForm()>
in C<DatatableGroup.js> before save.
=back
=back
=head1 AUTHOR
Daniel Brosseau <dab@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Daniel Brosseau.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 0.592 second using v1.01-cache-2.11-cpan-ad19def0cd9 )