X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAuth.pm;h=33007a4171dd348064cff3ee6ae687b9c5937c5a;hb=7b447b4dd0e756dc1578c44601d352811b768514;hp=82513b98d4d7feb4ddf437440727af09fd4e9d33;hpb=2a496ad85e9117b7cfaaa315b208f478eba30ffd;p=kivitendo-erp.git diff --git a/SL/Auth.pm b/SL/Auth.pm index 82513b98d..33007a417 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -1229,6 +1229,15 @@ sub check_right { return $granted; } +sub deny_access { + my ($self) = @_; + + $::dispatcher->reply_with_json_error(error => 'access') if $::request->type eq 'json'; + + delete $::form->{title}; + $::form->show_generic_error($::locale->text("You do not have the permissions to access this function.")); +} + sub assert { my ($self, $right, $dont_abort) = @_; @@ -1237,10 +1246,7 @@ sub assert { } if (!$dont_abort) { - $::dispatcher->reply_with_json_error(error => 'access') if $::request->type eq 'json'; - - delete $::form->{title}; - $::form->show_generic_error($::locale->text("You do not have the permissions to access this function.")); + $self->deny_access; } return 0;