Search in sources :

Example 1 with SecurityCheck

use of com.yahoo.elide.annotation.SecurityCheck in project elide by yahoo.

the class EntityDictionary method addSecurityCheck.

/**
 * Add security checks and bind them to the dictionary.
 * @param cls Security check class.
 */
public void addSecurityCheck(Class<?> cls) {
    if (Check.class.isAssignableFrom(cls)) {
        SecurityCheck securityCheckMeta = cls.getAnnotation(SecurityCheck.class);
        log.debug("Register Elide Check [{}] with expression [{}]", cls.getCanonicalName(), securityCheckMeta.value());
        checkNames.put(securityCheckMeta.value(), cls.asSubclass(Check.class));
        // Populate check instance.
        getCheckInstance(securityCheckMeta.value());
    } else {
        throw new IllegalStateException("Class annotated with SecurityCheck is not a Check");
    }
}
Also used : SecurityCheck(com.yahoo.elide.annotation.SecurityCheck) UserCheck(com.yahoo.elide.core.security.checks.UserCheck) Check(com.yahoo.elide.core.security.checks.Check) SecurityCheck(com.yahoo.elide.annotation.SecurityCheck)

Aggregations

SecurityCheck (com.yahoo.elide.annotation.SecurityCheck)1 Check (com.yahoo.elide.core.security.checks.Check)1 UserCheck (com.yahoo.elide.core.security.checks.UserCheck)1