#929 implement first half of multi tenancy with tenant_databases setting

This commit is contained in:
Oliver Gorwits
2022-09-24 19:01:05 +01:00
parent b391f83d60
commit 1d5f3ce316
71 changed files with 355 additions and 205 deletions

View File

@@ -29,13 +29,13 @@ ajax '/ajax/portcontrol' => require_any_role [qw(admin port_control)] => sub {
? (param('action') ."-other")
: param('value'));
schema('netdisco')->txn_do(sub {
schema(vars->{'tenant'})->txn_do(sub {
if (param('port')) {
my $act = "$action $subaction";
$act =~ s/-other$//;
$act =~ s/^portcontrol/port/;
schema('netdisco')->resultset('DevicePortLog')->create({
schema(vars->{'tenant'})->resultset('DevicePortLog')->create({
ip => param('device'),
port => param('port'),
action => $act,