]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/AuthGroup.pm
Rose-Models für Mandantentabellen
[mfinanz.git] / SL / DB / AuthGroup.pm
index 8bd54506ca70fd844f7024a6d27b98266196cc33..3d301775fb6e42a66d29a51ec5f99e88a9f78c16 100644 (file)
@@ -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;