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) = @_;
}
if (!$dont_abort) {
- delete $::form->{title};
- $::form->show_generic_error($::locale->text("You do not have the permissions to access this function."));
+ $self->deny_access;
}
return 0;