@Test public void testOwnerUnethical() throws TaskPermissionsException { when(permission.isOwnerPermission()).thenReturn(Boolean.FALSE); System.setProperty(Sejda.UNETHICAL_READ_PROPERTY_NAME, "true"); victim.ensureOwnerPermissions(); System.setProperty(Sejda.UNETHICAL_READ_PROPERTY_NAME, "false"); }
public void ensureOwnerPermissions() throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !permissions.isOwnerPermission()) { throw new TaskPermissionsException("Owner permission is required."); } }
PDDocumentAccessPermission { public void ensureOwnerPermissions() throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !permissions.isOwnerPermission()) { throw new TaskPermissionsException("Owner permission is required."); } } }
PDDocumentAccessPermission { public void ensureOwnerPermissions() throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !permissions.isOwnerPermission()) { throw new TaskPermissionsException("Owner permission is required."); } } PDDocumentAccessPermission(PDDocument document); }
PDDocumentAccessPermission { public void ensureOwnerPermissions() throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !permissions.isOwnerPermission()) { throw new TaskPermissionsException("Owner permission is required."); } } PDDocumentAccessPermission(PDDocument document); void ensureOwnerPermissions(); void ensurePermission(PdfAccessPermission required); }
PDDocumentAccessPermission { public void ensureOwnerPermissions() throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !permissions.isOwnerPermission()) { throw new TaskPermissionsException("Owner permission is required."); } } PDDocumentAccessPermission(PDDocument document); void ensureOwnerPermissions(); void ensurePermission(PdfAccessPermission required);  }