Prechádzať zdrojové kódy

[加密] - 权限判断是否可以编辑PDF

liujiajie 11 mesiacov pred
rodič
commit
6b2c19f955

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift

@@ -210,7 +210,7 @@ class KMToolbarViewController: NSViewController, NSTextFieldDelegate {
                 KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
                 return
             }
-            if self.pdfView.document.permissionsStatus != .owner /*!self.pdfView.document!.allowsPrinting || !self.pdfView.document!.allowsCopying*/ {
+            if !self.pdfView.document!.allowsPrinting || !self.pdfView.document!.allowsCopying {
                 let alert = NSAlert()
                 alert.alertStyle = .critical
                 alert.messageText = NSLocalizedString("This is a secured document. Editing is not permitted.", comment: "")

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -4594,7 +4594,7 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                 } else if itemID == KMDocumentScanOCRToolbarItemIdentifier {
                     showOCRWindow()
                 } else if itemID == KMDocumentDigitalSignToolbarItemIdentifier {
-                    if self.listView.document.permissionsStatus != .owner /*!self.pdfView.document!.allowsPrinting || !self.pdfView.document!.allowsCopying*/ {
+                    if !self.listView.document!.allowsPrinting || !self.listView.document!.allowsCopying {
                         let alert = NSAlert()
                         alert.alertStyle = .critical
                         alert.messageText = NSLocalizedString("This is a secured document. Editing is not permitted.", comment: "")