use of eu.bcvsolutions.idm.core.security.api.domain.Enabled in project CzechIdMng by bcvsolutions.
the class DefaultEnabledEvaluator method isEnabled.
/**
* Returns true, if given class is enabled (or does not have enabled annotation defined).
*
* @param bean service, manager etc.
* @return
*/
@Override
public boolean isEnabled(Class<?> clazz) {
Assert.notNull(clazz, "Class is required.");
//
Enabled enabled = clazz.getAnnotation(Enabled.class);
if (enabled == null) {
// bean is enabled
return true;
}
return isEnabled(enabled);
}
use of eu.bcvsolutions.idm.core.security.api.domain.Enabled in project CzechIdMng by bcvsolutions.
the class DefaultEnabledEvaluatorUnitTest method testEmptyAsTrue.
/**
* Empty annotation will be ignored
*/
@Test
public void testEmptyAsTrue() {
// no exception occurs
Enabled enabled = prepareAnnotation(null, null, false);
evaluator.checkEnabled(enabled);
assertTrue(evaluator.isEnabled(enabled));
}
Aggregations