@Test(expected = TaskPermissionsException.class) public void testNotOwner() throws TaskPermissionsException { when(permission.isOwnerPermission()).thenReturn(Boolean.FALSE); victim.ensureOwnerPermissions(); }
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);  }