@Test public void validate_notGranted() throws RepositoryException { Collection<String> actions = Arrays.asList(); when(cqActions.getAllowedActions(Mockito.any(), Mockito.any())).thenReturn(actions); assertFalse(validator.validate(true).isSuccessful()); }
@Override public ValidationResult validate(boolean simulate) { ValidationResult resourceResult = super.validate(simulate); if (!resourceResult.isSuccessful()) { return resourceResult; } if (!pageExists()) { return new ValidationResult(false, true, "Page not found"); } return canReadPageWithUser(); }
ReadPageAccessValidator extends ReadAccessValidator { @Override public ValidationResult validate(boolean simulate) { ValidationResult resourceResult = super.validate(simulate); if (!resourceResult.isSuccessful()) { return resourceResult; } if (!pageExists()) { return new ValidationResult(false, true, "Page not found"); } return canReadPageWithUser(); } }
ReadPageAccessValidator extends ReadAccessValidator { @Override public ValidationResult validate(boolean simulate) { ValidationResult resourceResult = super.validate(simulate); if (!resourceResult.isSuccessful()) { return resourceResult; } if (!pageExists()) { return new ValidationResult(false, true, "Page not found"); } return canReadPageWithUser(); } ReadPageAccessValidator(Group group, Resource resource, AccessValidatorContext context, boolean checkAccessGranted); }
ReadPageAccessValidator extends ReadAccessValidator { @Override public ValidationResult validate(boolean simulate) { ValidationResult resourceResult = super.validate(simulate); if (!resourceResult.isSuccessful()) { return resourceResult; } if (!pageExists()) { return new ValidationResult(false, true, "Page not found"); } return canReadPageWithUser(); } ReadPageAccessValidator(Group group, Resource resource, AccessValidatorContext context, boolean checkAccessGranted); @Override ValidationResult validate(boolean simulate); @Override String getLabel(); }
ReadPageAccessValidator extends ReadAccessValidator { @Override public ValidationResult validate(boolean simulate) { ValidationResult resourceResult = super.validate(simulate); if (!resourceResult.isSuccessful()) { return resourceResult; } if (!pageExists()) { return new ValidationResult(false, true, "Page not found"); } return canReadPageWithUser(); } ReadPageAccessValidator(Group group, Resource resource, AccessValidatorContext context, boolean checkAccessGranted); @Override ValidationResult validate(boolean simulate); @Override String getLabel();  }