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");
}
}
Aggregations