X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a5ba22d29e683629d731fc0bfdfb72719e59a0b9..3e29b95e9880aad25d13f4f410fda4ee1f1c5e9d:/SL/DB/AuthGroup.pm diff --git a/SL/DB/AuthGroup.pm b/SL/DB/AuthGroup.pm index 8bd54506c..2bb168eaf 100644 --- a/SL/DB/AuthGroup.pm +++ b/SL/DB/AuthGroup.pm @@ -1,18 +1,11 @@ -# 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::AuthGroup; use strict; use SL::DB::MetaSetup::AuthGroup; +use SL::DB::Manager::AuthGroup; use SL::DB::AuthGroupRight; -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - -__PACKAGE__->meta->schema('auth'); - __PACKAGE__->meta->add_relationship( users => { type => 'many to many', @@ -25,8 +18,19 @@ __PACKAGE__->meta->add_relationship( class => 'SL::DB::AuthGroupRight', column_map => { id => 'group_id' }, }, + clients => { + type => 'many to many', + map_class => 'SL::DB::AuthClientGroup', + map_from => 'group', + map_to => 'client', + }, ); __PACKAGE__->meta->initialize; +sub get_employees { + my @logins = map { $_->login } $_[0]->users; + return @logins ? @{ SL::DB::Manager::Employee->get_all(query => [ login => \@logins ]) } : (); +} + 1;