#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

@@ -63,7 +63,7 @@ hook 'before_template' => sub {
get '/device' => require_login sub {
my $q = param('q');
my $devices = schema('netdisco')->resultset('Device');
my $devices = schema(vars->{'tenant'})->resultset('Device');
# we are passed either dns or ip
my $dev = $devices->search({
@@ -86,7 +86,7 @@ get '/device' => require_login sub {
template 'device', {
is_pseudo => $first->is_pseudo,
display_name => ($others ? $first->ip : ($first->dns || $first->ip)),
lgroup_list => [ schema('netdisco')->resultset('Device')->get_distinct_col('location') ],
lgroup_list => [ schema(vars->{'tenant'})->resultset('Device')->get_distinct_col('location') ],
hgroup_list => setting('host_group_displaynames'),
device => params->{'tab'},
}, { layout => 'main' };