X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a5ba22d29e683629d731fc0bfdfb72719e59a0b9..3ced230d576cb0eff6f8b7805f1682c14e009ef9:/SL/DB/AuthGroup.pm diff --git a/SL/DB/AuthGroup.pm b/SL/DB/AuthGroup.pm index 8bd54506c..3d301775f 100644 --- a/SL/DB/AuthGroup.pm +++ b/SL/DB/AuthGroup.pm @@ -25,8 +25,19 @@ __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; +sub get_employees { + my @logins = map { $_->login } $_[0]->users; + return @logins ? @{ SL::DB::Manager::Employee->get_all(query => [ login => \@logins ]) } : (); +} + 1;