* <pre>
* allow [ inherit somePropertyName ] [ aclRule ];
* </pre>
*/
Rule Allow() {
final Var<AllowBlock> var = new Var<AllowBlock>(new AllowBlock());
final Var<Boolean> only = new Var<Boolean>(false);
return Sequence(
"allow",
Optional("only", ACTION(only.set(true))),
MaybeInherit(Property.class, var),
ZeroOneOrBlock(AclRule(), AllowRule.class),
new Action<Object>() {
@Override
@SuppressWarnings("unchecked")
public boolean run(Context<Object> ctx) {
AllowBlock x = var.get();
x.setAclRules((List<AllowRule>) pop());
x.setOnly(only.get());
push(x);
return true;
}
});
}