special_chars: ø, Ø und λ ergänzt
[kivitendo-erp.git] / SL / DB / Employee.pm
1 package SL::DB::Employee;
2
3 use strict;
4
5 use SL::DB::MetaSetup::Employee;
6 use SL::DB::Manager::Employee;
7
8 __PACKAGE__->meta->add_relationship(
9   project_invoice_permissions  => {
10     type       => 'many to many',
11     map_class  => 'SL::DB::EmployeeProjectInvoices',
12   },
13 );
14
15 __PACKAGE__->meta->initialize;
16
17 sub has_right {
18   my $self  = shift;
19   my $right = shift;
20
21   return $::auth->check_right($self->login, $right);
22 }
23
24 sub safe_name {
25   my ($self) = @_;
26
27   return $self->name || $self->login;
28 }
29
30 1;