Search in sources :

Example 1 with ExpressionResultCache

use of com.yahoo.elide.core.security.permissions.ExpressionResultCache in project elide by yahoo.

the class PermissionToFilterExpressionVisitorTest method setupEntityDictionary.

@BeforeEach
public void setupEntityDictionary() {
    Map<String, Class<? extends Check>> checks = new HashMap<>();
    checks.put(AT_OP_ALLOW, Permissions.Succeeds.class);
    checks.put(AT_OP_DENY, Permissions.Fails.class);
    checks.put(USER_ALLOW, Role.ALL.class);
    checks.put(USER_DENY, Role.NONE.class);
    checks.put(IN_FILTER, Permissions.InFilterExpression.class);
    checks.put(NOT_IN_FILTER, Permissions.NotInFilterExpression.class);
    checks.put(LT_FILTER, Permissions.LessThanFilterExpression.class);
    checks.put(GE_FILTER, Permissions.GreaterThanOrEqualFilterExpression.class);
    dictionary = TestDictionary.getTestDictionary(checks);
    elideSettings = new ElideSettingsBuilder(null).withEntityDictionary(dictionary).build();
    requestScope = newRequestScope();
    cache = new ExpressionResultCache();
}
Also used : Role(com.yahoo.elide.core.security.checks.prefab.Role) ElideSettingsBuilder(com.yahoo.elide.ElideSettingsBuilder) HashMap(java.util.HashMap) OperationCheck(com.yahoo.elide.core.security.checks.OperationCheck) FilterExpressionCheck(com.yahoo.elide.core.security.checks.FilterExpressionCheck) Check(com.yahoo.elide.core.security.checks.Check) EntityPermissions(com.yahoo.elide.core.dictionary.EntityPermissions) ExpressionResultCache(com.yahoo.elide.core.security.permissions.ExpressionResultCache) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ElideSettingsBuilder (com.yahoo.elide.ElideSettingsBuilder)1 EntityPermissions (com.yahoo.elide.core.dictionary.EntityPermissions)1 Check (com.yahoo.elide.core.security.checks.Check)1 FilterExpressionCheck (com.yahoo.elide.core.security.checks.FilterExpressionCheck)1 OperationCheck (com.yahoo.elide.core.security.checks.OperationCheck)1 Role (com.yahoo.elide.core.security.checks.prefab.Role)1 ExpressionResultCache (com.yahoo.elide.core.security.permissions.ExpressionResultCache)1 HashMap (java.util.HashMap)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1