projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DeliveryOrder: absicherung gegen leere stock Einträge
[kivitendo-erp.git]
/
SL
/
Menu.pm
diff --git
a/SL/Menu.pm
b/SL/Menu.pm
index
0e92cc5
..
0c6df22
100644
(file)
--- a/
SL/Menu.pm
+++ b/
SL/Menu.pm
@@
-3,14
+3,9
@@
package SL::Menu;
use strict;
use SL::Auth;
use strict;
use SL::Auth;
-use YAML ();
use File::Spec;
use SL::MoreCommon qw(uri_encode);
use File::Spec;
use SL::MoreCommon qw(uri_encode);
-
-our $yaml_xs;
-BEGIN {
- $yaml_xs = eval { require YAML::XS };
-}
+use SL::YAML;
our %menu_cache;
our %menu_cache;
@@
-29,11
+24,7
@@
sub new {
for my $file (@files) {
my $data;
eval {
for my $file (@files) {
my $data;
eval {
- if ($yaml_xs) {
- $data = YAML::XS::LoadFile(File::Spec->catfile($path, $file));
- } else {
- $data = YAML::LoadFile(File::Spec->catfile($path, $file));
- }
+ $data = SL::YAML::LoadFile(File::Spec->catfile($path, $file));
1;
} or do {
die "Error while parsing $file: $@";
1;
} or do {
die "Error while parsing $file: $@";
@@
-180,7
+171,7
@@
sub parse_access_string {
my $access = $node->{access};
my $access = $node->{access};
- while ($access =~ m/^([a-z_\/]+|\||\&|\(|\)|\s+)/) {
+ while ($access =~ m/^([a-z_\/]+|\
!|\
||\&|\(|\)|\s+)/) {
my $token = $1;
substr($access, 0, length($1)) = "";
my $token = $1;
substr($access, 0, length($1)) = "";
@@
-199,7
+190,7
@@
sub parse_access_string {
}
$cur_ary = $stack[-1];
}
$cur_ary = $stack[-1];
- } elsif (($token eq "|") || ($token eq "&")) {
+ } elsif (($token eq "|") || ($token eq "&")
|| ($token eq "!")
) {
push @{$cur_ary}, $token;
} else {
push @{$cur_ary}, $token;
} else {
@@
-273,4
+264,3
@@
sub set_access {
}
1;
}
1;
-