* Get the current permission flags. * * Returns all permissions as true for unencrypted documents. * For encrypted documents authenticated with owner password, all are true. * * @returns Current permission flags * * @example * ```typescript * const perms = pdf.getPermissio
()
| 845 | * ``` |
| 846 | */ |
| 847 | getPermissions(): Permissions { |
| 848 | const handler = this.ctx.info.securityHandler; |
| 849 | |
| 850 | if (!this.isEncrypted || !handler) { |
| 851 | return DEFAULT_PERMISSIONS; |
| 852 | } |
| 853 | |
| 854 | // Owner access grants all permissions |
| 855 | if (handler.hasOwnerAccess) { |
| 856 | return DEFAULT_PERMISSIONS; |
| 857 | } |
| 858 | |
| 859 | return handler.permissions; |
| 860 | } |
| 861 | |
| 862 | /** |
| 863 | * Check if the document was authenticated with owner-level access. |
no outgoing calls
no test coverage detected