Finanzbuchhaltung: schönere »…verbucht«-Meldungen via Flash
[kivitendo-erp.git] / SL / Controller / CsvImport.pm
index 86cecfe..fa988cb 100644 (file)
@@ -40,7 +40,7 @@ use Rose::Object::MakeMethods::Generic
  ],
 );
 
-__PACKAGE__->run_before('check_auth');
+__PACKAGE__->run_before('check_auth', except => [ qw(report) ]);
 __PACKAGE__->run_before('ensure_form_structure');
 __PACKAGE__->run_before('check_type', except => [ qw(report) ]);
 __PACKAGE__->run_before('load_all_profiles');
@@ -98,7 +98,6 @@ sub action_result {
   my $data = $self->{background_job}->data_as_hash;
 
   my $profile = SL::DB::Manager::CsvImportProfile->find_by(id => $data->{profile_id});
-
   $self->profile($profile);
 
   if ($data->{errors} and my $first_error =  $data->{errors}->[0]) {
@@ -267,7 +266,8 @@ sub action_add_mapping_from_upload {
 #
 
 sub check_auth {
-  $::auth->assert('config');
+  $_[0]->check_type;
+  $_[0]->worker->check_auth;
 }
 
 sub check_type {
@@ -414,7 +414,7 @@ sub load_default_profile {
 
   my $profile;
   if ($::form->{profile}->{id}) {
-    $profile = SL::DB::Manager::CsvImportProfile->find_by(id => $::form->{profile}->{id}, login => $::myconfig{login});
+    $profile = SL::DB::Manager::CsvImportProfile->find_by(id => $::form->{profile}->{id});
   }
   $profile ||= SL::DB::Manager::CsvImportProfile->find_by(type => $self->{type}, is_default => 1, login => $::myconfig{login});
   $profile ||= SL::DB::CsvImportProfile->new(type => $self->{type}, login => $::myconfig{login});