($self->{SESSION}{$key} //= SL::Auth::SessionValue->new(auth => $self, key => $key))->get
}
-sub create_unique_sesion_value {
+sub create_unique_session_value {
my ($self, $value, %params) = @_;
$self->{SESSION} ||= { };
$data->{$key} = $form->{$key} if !ref($form->{$key}) || $non_scalars;
}
- return $self->create_unique_sesion_value($data, %params);
+ return $self->create_unique_session_value($data, %params);
}
sub restore_form_from_session {
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) {
- $::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;
Retrieve a value from the session. Returns C<undef> if the value
doesn't exist.
-=item C<create_unique_sesion_value $value, %params>
+=item C<create_unique_session_value $value, %params>
Create a unique key in the session and store C<$value>
there.
=item C<save_form_in_session %params>
Stores the content of C<$params{form}> (default: C<$::form>) in the
-session using L</create_unique_sesion_value>.
+session using L</create_unique_session_value>.
If C<$params{non_scalars}> is trueish then non-scalar values will be
stored as well. Default is to only store scalar values.