projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git]
/
SL
/
DB
/
Employee.pm
diff --git
a/SL/DB/Employee.pm
b/SL/DB/Employee.pm
index
4cc109a
..
0c321b6
100644
(file)
--- a/
SL/DB/Employee.pm
+++ b/
SL/DB/Employee.pm
@@
-5,6
+5,13
@@
use strict;
use SL::DB::MetaSetup::Employee;
use SL::DB::Manager::Employee;
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 {
__PACKAGE__->meta->initialize;
sub has_right {
@@
-20,4
+27,14
@@
sub safe_name {
return $self->name || $self->login;
}
return $self->name || $self->login;
}
+sub auth_user {
+ my ($self) = @_;
+
+ die 'not an accessor' if scalar(@_) > 1;
+
+ require SL::DB::AuthUser;
+
+ return SL::DB::Manager::AuthUser->find_by(login => $self->login);
+}
+
1;
1;