[
https://issues.apache.org/jira/browse/PDFBOX-314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
John Hewson closed PDFBOX-314.
------------------------------
Resolution: Cannot Reproduce
> StandardSecurityHandler not setting currentAccessPermission
> -----------------------------------------------------------
>
> Key: PDFBOX-314
> URL: https://issues.apache.org/jira/browse/PDFBOX-314
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Priority: Minor
>
> [imported from SourceForge]
> http://sourceforge.net/tracker/index.php?group_id=78314&atid=552832&aid=1807062
> Originally submitted by bernie9998 on 2007-10-03 10:02.
> I've noticed that if I try to get the currentAccessPermission from a
> protected document, what I actually get is a null pointer.
> Looking through the source, it seems the issue is that
> StandardSecurityHandler never actually sets currentAccessPermission after it
> decrypts the document. Thus, when PDDocument tries to get the
> currentAccessPermission, it gets the initial null pointer
> currentAccessPermission is initialized to, as securityHandler is not null.
> I believe that StandardSecurityHandler should set the currentAccessPermission
> with the permissions obtained in the encryptionDictionary.
> [attachment on SourceForge]
> http://sourceforge.net/tracker/download.php?group_id=78314&atid=552832&aid=1807062&file_id=248232
> PDFBox-SetAcessPermissions.patch (text/x-diff), 1372 bytes
> patch that sets currentAccessPermission in StandardSecurityHandler
> [comment on SourceForge]
> Originally sent by bernie9998.
> Logged In: YES
> user_id=1752908
> Originator: YES
> I am attaching a patch which sets currentAccessPermissions from the
> encryptionDictionary in the decrypt method.
> It allows involves a new AccessPermission constructor that allows permissions
> to be set from an int rather than a byte array.
> I've tested this with a pdf document that had setCanPrint to false and found
> this to work in this case.
> File Added: PDFBox-SetAcessPermissions.patch
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)