aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2/src
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-05-20 09:50:11 +0200
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-05-20 09:50:11 +0200
commit6047c5d39b4c09cd45cf8642a990ede4eb2a7c2a (patch)
tree16e94b0b7b3eaefd85393db352dec68c79cc2860 /pdf-as-pdfbox-2/src
parent77cc1a7b56632d36efba616d5fd8cf4aac93b30e (diff)
downloadpdf-as-4-6047c5d39b4c09cd45cf8642a990ede4eb2a7c2a.tar.gz
pdf-as-4-6047c5d39b4c09cd45cf8642a990ede4eb2a7c2a.tar.bz2
pdf-as-4-6047c5d39b4c09cd45cf8642a990ede4eb2a7c2a.zip
Update checkPDFPermissions
Diffstat (limited to 'pdf-as-pdfbox-2/src')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java
index d072a474..112d9a86 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/utils/PdfBoxUtils.java
@@ -18,7 +18,14 @@ public class PdfBoxUtils {
throws PdfAsValidationException {
AccessPermission accessPermission = doc.getCurrentAccessPermission();
if (doc.isEncrypted() || !accessPermission.isOwnerPermission()) {
- if (accessPermission.canModify() || accessPermission.canModifyAnnotations()
+ //canFillInForm()
+ //This will tell if the user can fill in interactive form fields (including signature fields) even if
+ // canModifyAnnotations() returns false.
+
+ //canModifyAnnotations()
+ //This will tell if the user can add or modify text annotations and fill in interactive forms fields and, if
+ // canModify() returns true, create or modify interactive form fields (including signature fields).
+ if ((accessPermission.canModify() && accessPermission.canModifyAnnotations())
|| accessPermission.canFillInForm()) {
logger.debug("Document is protected, but Signing is allowed");