use of com.yahoo.elide.core.security.visitors.PermissionExpressionVisitor in project elide by yahoo.
the class PermissionExpressionVisitorTest method getExpressionForPermission.
private Expression getExpressionForPermission(Class<? extends Annotation> permission, Type model) {
PermissionExpressionVisitor v = new PermissionExpressionVisitor(dictionary, DummyExpression::new);
ParseTree permissions = dictionary.getPermissionsForClass(model, permission);
return v.visit(permissions);
}
use of com.yahoo.elide.core.security.visitors.PermissionExpressionVisitor in project elide by yahoo.
the class PermissionToFilterExpressionVisitorTest method filterExpressionForPermissions.
private FilterExpression filterExpressionForPermissions(String permission) {
Function<Check, Expression> checkFn = (check) -> new CheckExpression(check, null, requestScope, null, cache);
ParseTree expression = EntityPermissions.parseExpression(permission);
PermissionToFilterExpressionVisitor fev = new PermissionToFilterExpressionVisitor(dictionary, requestScope, null);
return expression.accept(new PermissionExpressionVisitor(dictionary, checkFn)).accept(NORMALIZATION_VISITOR).accept(fev);
}
use of com.yahoo.elide.core.security.visitors.PermissionExpressionVisitor in project elide by yahoo.
the class PermissionExpressionNormalizationVisitorTest method setUp.
@BeforeAll
public void setUp() {
EntityDictionary dictionary = TestDictionary.getTestDictionary();
ElideSettings elideSettings = new ElideSettingsBuilder(null).withEntityDictionary(dictionary).build();
RequestScope requestScope = new RequestScope(null, null, NO_VERSION, null, null, null, null, null, UUID.randomUUID(), elideSettings);
permissionExpressionVisitor = new PermissionExpressionVisitor(dictionary, (check -> new CheckExpression(check, null, requestScope, null, null)));
normalizationVisitor = new PermissionExpressionNormalizationVisitor();
}
Aggregations