@Test public void testAssemble() throws TaskPermissionsException { when(permission.canAssembleDocument()).thenReturn(Boolean.TRUE); victim.ensurePermission(PdfAccessPermission.ASSEMBLE); }
public void ensurePermission(PdfAccessPermission required) throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !ForwardingPdfAccessPermission.valueFromPdfAccessPermission(required).isAllowed(permissions)) { throw new TaskPermissionsException(String.format("Permission %s is not granted.", required)); } }
PDDocumentAccessPermission { public void ensurePermission(PdfAccessPermission required) throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !ForwardingPdfAccessPermission.valueFromPdfAccessPermission(required).isAllowed(permissions)) { throw new TaskPermissionsException(String.format("Permission %s is not granted.", required)); } } }
PDDocumentAccessPermission { public void ensurePermission(PdfAccessPermission required) throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !ForwardingPdfAccessPermission.valueFromPdfAccessPermission(required).isAllowed(permissions)) { throw new TaskPermissionsException(String.format("Permission %s is not granted.", required)); } } PDDocumentAccessPermission(PDDocument document); }
PDDocumentAccessPermission { public void ensurePermission(PdfAccessPermission required) throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !ForwardingPdfAccessPermission.valueFromPdfAccessPermission(required).isAllowed(permissions)) { throw new TaskPermissionsException(String.format("Permission %s is not granted.", required)); } } PDDocumentAccessPermission(PDDocument document); void ensureOwnerPermissions(); void ensurePermission(PdfAccessPermission required); }
PDDocumentAccessPermission { public void ensurePermission(PdfAccessPermission required) throws TaskPermissionsException { if (!Boolean.getBoolean(Sejda.UNETHICAL_READ_PROPERTY_NAME) && !ForwardingPdfAccessPermission.valueFromPdfAccessPermission(required).isAllowed(permissions)) { throw new TaskPermissionsException(String.format("Permission %s is not granted.", required)); } } PDDocumentAccessPermission(PDDocument document); void ensureOwnerPermissions(); void ensurePermission(PdfAccessPermission required);  }