Revision 78b23538
Von Bernd Bleßmann vor mehr als 6 Jahren hinzugefügt
SL/Auth.pm | ||
---|---|---|
1077 | 1077 |
|
1078 | 1078 |
my $value = 0; |
1079 | 1079 |
my $action = '|'; |
1080 |
my $negate = 0; |
|
1080 | 1081 |
|
1081 | 1082 |
foreach my $el (@{$ary}) { |
1082 | 1083 |
if (ref $el eq "ARRAY") { |
1084 |
my $val = evaluate_rights_ary($el); |
|
1085 |
$val = !$val if $negate; |
|
1086 |
$negate = 0; |
|
1083 | 1087 |
if ($action eq '|') { |
1084 |
$value |= evaluate_rights_ary($el);
|
|
1088 |
$value |= $val;
|
|
1085 | 1089 |
} else { |
1086 |
$value &= evaluate_rights_ary($el);
|
|
1090 |
$value &= $val;
|
|
1087 | 1091 |
} |
1088 | 1092 |
|
1089 | 1093 |
} elsif (($el eq '&') || ($el eq '|')) { |
1090 | 1094 |
$action = $el; |
1091 | 1095 |
|
1096 |
} elsif ($el eq '!') { |
|
1097 |
$negate = !$negate; |
|
1098 |
|
|
1092 | 1099 |
} elsif ($action eq '|') { |
1093 |
$value |= $el; |
|
1100 |
my $val = $el; |
|
1101 |
$val = !$val if $negate; |
|
1102 |
$negate = 0; |
|
1103 |
$value |= $val; |
|
1094 | 1104 |
|
1095 | 1105 |
} else { |
1096 |
$value &= $el; |
|
1106 |
my $val = $el; |
|
1107 |
$val = !$val if $negate; |
|
1108 |
$negate = 0; |
|
1109 |
$value &= $val; |
|
1097 | 1110 |
|
1098 | 1111 |
} |
1099 | 1112 |
} |
Auch abrufbar als: Unified diff
SL::Auth: evaluate_rights_ary: Negierung (!) ermöglichen