use of com.yahoo.elide.core.security.permissions.expressions.Expression in project elide by yahoo.
the class PermissionExpressionVisitorTest method testAndExpression.
@Test
public void testAndExpression() {
Expression expression = getExpressionForPermission(ReadPermission.class);
assertEquals(ExpressionResult.PASS, expression.evaluate(Expression.EvaluationMode.ALL_CHECKS));
}
use of com.yahoo.elide.core.security.permissions.expressions.Expression in project elide by yahoo.
the class PermissionExpressionVisitorTest method testComplexModelCreate.
@Test
public void testComplexModelCreate() {
Expression expression = getExpressionForPermission(CreatePermission.class, ClassType.of(ComplexEntity.class));
assertEquals(ExpressionResult.PASS, expression.evaluate(Expression.EvaluationMode.ALL_CHECKS));
}
use of com.yahoo.elide.core.security.permissions.expressions.Expression in project elide by yahoo.
the class PermissionExpressionVisitorTest method testNamesWithSpaces.
@Test
public void testNamesWithSpaces() {
Expression expression = getExpressionForPermission(DeletePermission.class, ClassType.of(ComplexEntity.class));
Expression expression2 = getExpressionForPermission(UpdatePermission.class, ClassType.of(ComplexEntity.class));
assertEquals(ExpressionResult.PASS, expression.evaluate(Expression.EvaluationMode.ALL_CHECKS));
assertEquals(ExpressionResult.PASS, expression2.evaluate(Expression.EvaluationMode.ALL_CHECKS));
}
use of com.yahoo.elide.core.security.permissions.expressions.Expression in project elide by yahoo.
the class PermissionExpressionVisitorTest method testOrExpression.
@Test
public void testOrExpression() {
Expression expression = getExpressionForPermission(UpdatePermission.class);
assertEquals(ExpressionResult.PASS, expression.evaluate(Expression.EvaluationMode.ALL_CHECKS));
}
use of com.yahoo.elide.core.security.permissions.expressions.Expression in project elide by yahoo.
the class PermissionExpressionVisitorTest method testNotExpression.
@Test
public void testNotExpression() {
Expression expression = getExpressionForPermission(DeletePermission.class);
assertEquals(ExpressionResult.PASS, expression.evaluate(Expression.EvaluationMode.ALL_CHECKS));
}
Aggregations