Factur-X/ZUGFeRD: Unterstütztung für Profil »XRechnung 2.0.0«
[kivitendo-erp.git] / SL / DB / Employee.pm
index 841696b..8da20c0 100644 (file)
@@ -1,13 +1,30 @@
-# 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::Employee;
 
 use strict;
 
 use SL::DB::MetaSetup::Employee;
+use SL::DB::Manager::Employee;
+
+__PACKAGE__->meta->add_relationship(
+  project_invoice_permissions  => {
+    type       => 'many to many',
+    map_class  => 'SL::DB::EmployeeProjectInvoices',
+  },
+);
+
+__PACKAGE__->meta->initialize;
+
+sub has_right {
+  my $self  = shift;
+  my $right = shift;
+
+  return $::auth->check_right($self->login, $right);
+}
+
+sub safe_name {
+  my ($self) = @_;
 
-# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
-__PACKAGE__->meta->make_manager_class;
+  return $self->name || $self->login;
+}
 
 1;