X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fmenu%2Fparse_access_string.t;h=521269995c9e4cd38c3659779f3acd8facf67e3a;hb=2e19657a12d946c4e9cdd1466af1bbab992284ee;hp=f1cbd4289e7d018e2bbf6cf314eb520ea0bf1b78;hpb=ffddb5c07960091a33cfd6f91b6a3245efdcccf2;p=kivitendo-erp.git diff --git a/t/menu/parse_access_string.t b/t/menu/parse_access_string.t index f1cbd4289..521269995 100644 --- a/t/menu/parse_access_string.t +++ b/t/menu/parse_access_string.t @@ -54,9 +54,27 @@ ok($menu->parse_access_string(\%node), 'parenthesis 1'); $node{access} = '(no_such_right & sales_order_edit | (no_such_right & sales_order_edit))'; ok(!$menu->parse_access_string(\%node), 'parenthesis 2'); -$node{access} = 'sales_quotation_edit & client/feature_experimental'; +$node{access} = 'sales_quotation_edit & client/feature_experimental_order'; ok($menu->parse_access_string(\%node), 'client'); +$node{access} = '!no_such_right'; +ok($menu->parse_access_string(\%node), 'simple negation 1'); + +$node{access} = '!sales_order_edit'; +ok(!$menu->parse_access_string(\%node), 'simple negation 2'); + +$node{access} = '!!sales_order_edit'; +ok($menu->parse_access_string(\%node), 'double negation'); + +$node{access} = '(no_such_right & sales_order_edit | !(no_such_right & sales_order_edit))'; +ok($menu->parse_access_string(\%node), 'parenthesis with negation 1'); + +$node{access} = '(no_such_right & sales_order_edit | (!no_such_right | !sales_order_edit))'; +ok($menu->parse_access_string(\%node), 'parenthesis with negation 2'); + +$node{access} = 'sales_quotation_edit & !client/feature_experimental_order'; +ok(!$menu->parse_access_string(\%node), 'client negation'); + done_testing; 1;