Jelajahi Sumber

【2025】【综合】菜单栏权限管理优化

niehaoyu 1 Minggu lalu
induk
melakukan
3b5a517117

+ 6 - 7
PDF Office/PDF Master/AppDelegate+MenuAction.swift

@@ -362,16 +362,15 @@ extension AppDelegate {
             } else if action == NSSelectorFromString("menuItemAction_addPassword:") {
                 
             } else if action == NSSelectorFromString("menuItemAction_removePassword:") {
-                if mainVC.listView.document.isLocked == true {
+                if mainVC.listView.document.isLocked == true || mainVC.listView.document.isEncrypted == true {
                     return true
-                } else {
-                    if let pw = mainVC.listView.document.password {
-                        return true
-                    }
-                    return false
                 }
+                return false
             } else if action == NSSelectorFromString("menuItemAction_unlockFunction:") {
-                return mainVC.listView.document.isEncrypted
+                if mainVC.listView.document.permissionsStatus != .owner {
+                    return true
+                }
+                return false
             } else if action == NSSelectorFromString("menuItemAction_searchPDF:") {
                 
             } else if action == NSSelectorFromString("menuItemAction_performFindPanelAction:") {

+ 1 - 1
PDF Office/PDF Master/Base.lproj/Main.storyboard

@@ -350,7 +350,7 @@
                                                             <action selector="menuItemAction_addPassword:" target="Voe-Tx-rLC" id="oiG-rS-Enk"/>
                                                         </connections>
                                                     </menuItem>
-                                                    <menuItem title="Decrypt with Password" id="mMv-ZS-fIa">
+                                                    <menuItem title="Remove Security" id="mMv-ZS-fIa">
                                                         <connections>
                                                             <action selector="menuItemAction_removePassword:" target="Voe-Tx-rLC" id="aWe-Om-2Uj"/>
                                                         </connections>