From 3ced230d576cb0eff6f8b7805f1682c14e009ef9 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 4 Jun 2013 15:55:03 +0200 Subject: [PATCH] =?utf8?q?Rose-Models=20f=C3=BCr=20Mandantentabellen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/AuthClient.pm | 32 +++++++++++++++++++++++++++++ SL/DB/AuthClientGroup.pm | 15 ++++++++++++++ SL/DB/AuthClientUser.pm | 15 ++++++++++++++ SL/DB/AuthGroup.pm | 6 ++++++ SL/DB/AuthUser.pm | 6 ++++++ SL/DB/Helper/ALL.pm | 3 +++ SL/DB/Helper/Mappings.pm | 13 +++++++----- SL/DB/MetaSetup/AuthClient.pm | 32 +++++++++++++++++++++++++++++ SL/DB/MetaSetup/AuthClientGroup.pm | 33 ++++++++++++++++++++++++++++++ SL/DB/MetaSetup/AuthClientUser.pm | 33 ++++++++++++++++++++++++++++++ 10 files changed, 183 insertions(+), 5 deletions(-) create mode 100644 SL/DB/AuthClient.pm create mode 100644 SL/DB/AuthClientGroup.pm create mode 100644 SL/DB/AuthClientUser.pm create mode 100644 SL/DB/MetaSetup/AuthClient.pm create mode 100644 SL/DB/MetaSetup/AuthClientGroup.pm create mode 100644 SL/DB/MetaSetup/AuthClientUser.pm diff --git a/SL/DB/AuthClient.pm b/SL/DB/AuthClient.pm new file mode 100644 index 000000000..5291da209 --- /dev/null +++ b/SL/DB/AuthClient.pm @@ -0,0 +1,32 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::AuthClient; + +use strict; + +use SL::DB::MetaSetup::AuthClient; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->schema('auth'); + +__PACKAGE__->meta->make_manager_class; + +__PACKAGE__->meta->add_relationship( + users => { + type => 'many to many', + map_class => 'SL::DB::AuthUserGroup', + map_from => 'client', + map_to => 'user', + }, + groups => { + type => 'many to many', + map_class => 'SL::DB::AuthUserGroup', + map_from => 'client', + map_to => 'group', + }, +); + +__PACKAGE__->meta->initialize; + +1; diff --git a/SL/DB/AuthClientGroup.pm b/SL/DB/AuthClientGroup.pm new file mode 100644 index 000000000..758841bbf --- /dev/null +++ b/SL/DB/AuthClientGroup.pm @@ -0,0 +1,15 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::AuthClientGroup; + +use strict; + +use SL::DB::MetaSetup::AuthClientGroup; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->schema('auth'); + +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/AuthClientUser.pm b/SL/DB/AuthClientUser.pm new file mode 100644 index 000000000..b2063dc53 --- /dev/null +++ b/SL/DB/AuthClientUser.pm @@ -0,0 +1,15 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::AuthClientUser; + +use strict; + +use SL::DB::MetaSetup::AuthClientUser; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->schema('auth'); + +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/AuthGroup.pm b/SL/DB/AuthGroup.pm index fe755c7b5..3d301775f 100644 --- a/SL/DB/AuthGroup.pm +++ b/SL/DB/AuthGroup.pm @@ -25,6 +25,12 @@ __PACKAGE__->meta->add_relationship( class => 'SL::DB::AuthGroupRight', column_map => { id => 'group_id' }, }, + clients => { + type => 'many to many', + map_class => 'SL::DB::AuthClient', + map_from => 'group', + map_to => 'client', + }, ); __PACKAGE__->meta->initialize; diff --git a/SL/DB/AuthUser.pm b/SL/DB/AuthUser.pm index 2a15449d6..c1b46b4ef 100644 --- a/SL/DB/AuthUser.pm +++ b/SL/DB/AuthUser.pm @@ -27,6 +27,12 @@ __PACKAGE__->meta->add_relationship( class => 'SL::DB::AuthUserConfig', column_map => { id => 'user_id' }, }, + clients => { + type => 'many to many', + map_class => 'SL::DB::AuthClient', + map_from => 'user', + map_to => 'client', + }, ); __PACKAGE__->meta->initialize; diff --git a/SL/DB/Helper/ALL.pm b/SL/DB/Helper/ALL.pm index f951bf9d0..9962406d2 100644 --- a/SL/DB/Helper/ALL.pm +++ b/SL/DB/Helper/ALL.pm @@ -5,6 +5,9 @@ use strict; use SL::DB::AccTransaction; use SL::DB::Assembly; use SL::DB::AuditTrail; +use SL::DB::AuthClient; +use SL::DB::AuthClientUser; +use SL::DB::AuthClientGroup; use SL::DB::AuthGroup; use SL::DB::AuthGroupRight; use SL::DB::AuthUser; diff --git a/SL/DB/Helper/Mappings.pm b/SL/DB/Helper/Mappings.pm index f0b8be9af..81f451248 100644 --- a/SL/DB/Helper/Mappings.pm +++ b/SL/DB/Helper/Mappings.pm @@ -37,11 +37,14 @@ my @lxoffice_blacklist = (@lxoffice_blacklist_permanent, @lxoffice_blacklist_tem my %lxoffice_package_names = ( acc_trans => 'acc_transaction', audittrail => 'audit_trail', - auth_group => 'auth_groups', - auth_group_right => 'auth_group_rights', - auth_user => 'auth_users', - auth_user_config => 'auth_user_configs', - auth_user_group => 'auth_user_groups', + 'auth.clients' => 'auth_client', + 'auth.clients_users' => 'auth_client_user', + 'auth.clients_groups' => 'auth_client_group', + 'auth.group' => 'auth_groups', + 'auth.group_right' => 'auth_group_rights', + 'auth.user' => 'auth_users', + 'auth.user_config' => 'auth_user_configs', + 'auth.user_group' => 'auth_user_groups', ar => 'invoice', ap => 'purchase_invoice', background_jobs => 'background_job', diff --git a/SL/DB/MetaSetup/AuthClient.pm b/SL/DB/MetaSetup/AuthClient.pm new file mode 100644 index 000000000..1b0a81a54 --- /dev/null +++ b/SL/DB/MetaSetup/AuthClient.pm @@ -0,0 +1,32 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::AuthClient; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'clients', + + columns => [ + id => { type => 'serial', not_null => 1 }, + name => { type => 'text', not_null => 1 }, + dbhost => { type => 'text', not_null => 1 }, + dbport => { type => 'integer', default => 5432, not_null => 1 }, + dbname => { type => 'text', not_null => 1 }, + dbuser => { type => 'text', not_null => 1 }, + dbpasswd => { type => 'text', not_null => 1 }, + is_default => { type => 'boolean', default => 'false', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + unique_keys => [ + [ 'dbhost', 'dbport', 'dbname' ], + [ 'name' ], + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/AuthClientGroup.pm b/SL/DB/MetaSetup/AuthClientGroup.pm new file mode 100644 index 000000000..e9226394e --- /dev/null +++ b/SL/DB/MetaSetup/AuthClientGroup.pm @@ -0,0 +1,33 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::AuthClientGroup; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'clients_groups', + + columns => [ + client_id => { type => 'integer', not_null => 1 }, + group_id => { type => 'integer', not_null => 1 }, + ], + + primary_key_columns => [ 'client_id', 'group_id' ], + + foreign_keys => [ + client => { + class => 'SL::DB::AuthClient', + key_columns => { client_id => 'id' }, + }, + + group => { + class => 'SL::DB::AuthGroup', + key_columns => { group_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/AuthClientUser.pm b/SL/DB/MetaSetup/AuthClientUser.pm new file mode 100644 index 000000000..b36577207 --- /dev/null +++ b/SL/DB/MetaSetup/AuthClientUser.pm @@ -0,0 +1,33 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::AuthClientUser; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'clients_users', + + columns => [ + client_id => { type => 'integer', not_null => 1 }, + user_id => { type => 'integer', not_null => 1 }, + ], + + primary_key_columns => [ 'client_id', 'user_id' ], + + foreign_keys => [ + client => { + class => 'SL::DB::AuthClient', + key_columns => { client_id => 'id' }, + }, + + user => { + class => 'SL::DB::AuthUser', + key_columns => { user_id => 'id' }, + }, + ], +); + +1; +; -- 2.20.1