]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/AuthUser.pm
Nicht mehr benötigte Felder beim Speichern von Usern weglassen
[mfinanz.git] / SL / DB / AuthUser.pm
index 0d22be94f8c7024f133b0a2155347bc1bb87a39c..c1b46b4ef79839844e5ff2793795fe4b858464c6 100644 (file)
@@ -5,6 +5,8 @@ package SL::DB::AuthUser;
 
 use strict;
 
 
 use strict;
 
+use List::Util qw(first);
+
 use SL::DB::MetaSetup::AuthUser;
 use SL::DB::AuthUserGroup;
 
 use SL::DB::MetaSetup::AuthUser;
 use SL::DB::AuthUserGroup;
 
@@ -25,8 +27,21 @@ __PACKAGE__->meta->add_relationship(
     class      => 'SL::DB::AuthUserConfig',
     column_map => { id => 'user_id' },
   },
     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;
 
 );
 
 __PACKAGE__->meta->initialize;
 
+sub get_config_value {
+  my ($self, $key) = @_;
+
+  my $cfg = first { $_->cfg_key eq $key } @{ $self->configs };
+  return $cfg ? $cfg->cfg_value : undef;
+}
+
 1;
 1;