summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJames R. Barlow <jim@purplerock.ca>2019-06-18 21:53:56 -0700
committerJames R. Barlow <jim@purplerock.ca>2019-06-18 21:53:56 -0700
commitdea146cec9e7473026a385dc65400a3ed46848b6 (patch)
tree95b8e4a199d2deb940ae44e48cd6908b0d3341de /tests
parent3fc1bacc6f80e6cc9c6e22fc8daafe45df294f43 (diff)
Fix setting access permissions on save
Diffstat (limited to 'tests')
-rw-r--r--tests/test_encrypt.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_encrypt.py b/tests/test_encrypt.py
index 89aebf3..0bcdec5 100644
--- a/tests/test_encrypt.py
+++ b/tests/test_encrypt.py
@@ -48,3 +48,11 @@ def test_encrypt_without_owner(trivial, outpdf):
def test_encrypt_no_passwords(trivial, outpdf):
trivial.save(outpdf, encryption=dict(R=6))
+
+
+def test_encrypt_permissions_deny(trivial, outpdf):
+ perms = pikepdf.models.PdfPermissions(extract=False)
+ trivial.save(outpdf, encryption=dict(owner='sun', user='moon', allow=perms))
+ pdf = pikepdf.open(outpdf, password='sun')
+ assert not pdf.allow.extract
+ assert pdf.allow.modify_form