@Test public void testCanValidate() { assertTrue(validator.canValidate(EntityNames.DISCIPLINE_ACTION, true)); assertTrue(validator.canValidate(EntityNames.DISCIPLINE_ACTION, false)); assertTrue(validator.canValidate(EntityNames.DISCIPLINE_INCIDENT, true)); assertTrue(validator.canValidate(EntityNames.DISCIPLINE_INCIDENT, false)); assertTrue(validator.canValidate(EntityNames.STUDENT_DISCIPLINE_INCIDENT_ASSOCIATION, true)); assertTrue(validator.canValidate(EntityNames.STUDENT_DISCIPLINE_INCIDENT_ASSOCIATION, false)); assertFalse(validator.canValidate(EntityNames.STUDENT, true)); assertFalse(validator.canValidate(EntityNames.STUDENT_GRADEBOOK_ENTRY, false)); assertTrue(validator.canValidate(EntityNames.PROGRAM, true)); assertFalse(validator.canValidate(EntityNames.PROGRAM, false)); }
@Override public boolean canValidate(String entityType, boolean isTransitive) { return isStudentOrParent() && (STUDENT_DENIED_ENTITIES.contains(entityType) || (isTransitive && EntityNames.isPublic(entityType)) || (!isTransitive && NON_TRANSITIVE_DENY_ALL .contains(entityType))); }
StudentDenyAllValidator extends AbstractContextValidator { @Override public boolean canValidate(String entityType, boolean isTransitive) { return isStudentOrParent() && (STUDENT_DENIED_ENTITIES.contains(entityType) || (isTransitive && EntityNames.isPublic(entityType)) || (!isTransitive && NON_TRANSITIVE_DENY_ALL .contains(entityType))); } }
StudentDenyAllValidator extends AbstractContextValidator { @Override public boolean canValidate(String entityType, boolean isTransitive) { return isStudentOrParent() && (STUDENT_DENIED_ENTITIES.contains(entityType) || (isTransitive && EntityNames.isPublic(entityType)) || (!isTransitive && NON_TRANSITIVE_DENY_ALL .contains(entityType))); }  }
StudentDenyAllValidator extends AbstractContextValidator { @Override public boolean canValidate(String entityType, boolean isTransitive) { return isStudentOrParent() && (STUDENT_DENIED_ENTITIES.contains(entityType) || (isTransitive && EntityNames.isPublic(entityType)) || (!isTransitive && NON_TRANSITIVE_DENY_ALL .contains(entityType))); }  @Override boolean canValidate(String entityType, boolean isTransitive); @Override Set<String> validate(String entityType, Set<String> ids); }
StudentDenyAllValidator extends AbstractContextValidator { @Override public boolean canValidate(String entityType, boolean isTransitive) { return isStudentOrParent() && (STUDENT_DENIED_ENTITIES.contains(entityType) || (isTransitive && EntityNames.isPublic(entityType)) || (!isTransitive && NON_TRANSITIVE_DENY_ALL .contains(entityType))); }  @Override boolean canValidate(String entityType, boolean isTransitive); @Override Set<String> validate(String entityType, Set<String> ids);  }