| 1 | package Daje::Plugin::Companies::Authorities; | ||
| 2 | use Mojo::Base -base, -signatures; | ||
| 3 | use v5.42; | ||
| 4 | |||
| 5 | # NAME | ||
| 6 | # ==== | ||
| 7 | # | ||
| 8 | # Daje::Plugin::Companies::Authorities - Model class | ||
| 9 | # | ||
| 10 | # SYNOPSIS | ||
| 11 | # ======== | ||
| 12 | # | ||
| 13 | # | ||
| 14 | # | ||
| 15 | # | ||
| 16 | # DESCRIPTION | ||
| 17 | # =========== | ||
| 18 | # | ||
| 19 | # Daje::Plugin::Companies::Authorities is the standard routes | ||
| 20 | # | ||
| 21 | # METHODS | ||
| 22 | # ======= | ||
| 23 | # | ||
| 24 | # | ||
| 25 | # LICENSE | ||
| 26 | # ======= | ||
| 27 | # | ||
| 28 | # Copyright (C) janeskil1525. | ||
| 29 | # | ||
| 30 | # This library is free software; you can redistribute it and/or modify | ||
| 31 | # it under the same terms as Perl itself. | ||
| 32 | # | ||
| 33 | # AUTHOR | ||
| 34 | # ====== | ||
| 35 | # | ||
| 36 | # janeskil1525 E<lt>janeskil1525@gmail.com | ||
| 37 | # | ||
| 38 | |||
| 39 | # This file is generated automatically by Daje Tools 2026-03-15 11:17:38. | ||
| 40 | # It will be generated by Daje Tools again. | ||
| 41 | # <!-- Autogenerated file 2026-03-15 11:17:38 --> | ||
| 42 | |||
| 43 | use Daje::Helper::Authorities::InsertPluginFunction; | ||
| 44 | |||
| 45 | has 'db'; | ||
| 46 | |||
| 47 | sub authorize($self) { | ||
| 48 | |||
| 49 | try { | ||
| 50 | my $tx = $self->db->begin; | ||
| 51 | my @functions = ( | ||
| 52 | "companies_users", | ||
| 53 | "companies_companies" | ||
| 54 | ); | ||
| 55 | |||
| 56 | Daje::Helper::Authorities::InsertPluginFunction->new( | ||
| 57 | db => $self->db | ||
| 58 | )->process( | ||
| 59 | "companies", \@functions | ||
| 60 | ); | ||
| 61 | $tx->commit(); | ||
| 62 | } catch($e) { | ||
| 63 | say $e; | ||
| 64 | } | ||
| 65 | } | ||
| 66 | |||
| 67 | 1; | ||
| 68 |