diff --git a/pypdf/constants.py b/pypdf/constants.py index 49d897308..884dbaedf 100644 --- a/pypdf/constants.py +++ b/pypdf/constants.py @@ -91,7 +91,7 @@ def _is_reserved(cls, name: str) -> bool: return name.startswith("R") and name[1:].isdigit() @classmethod - def _defaults_to_one(cls, name: str) -> bool: + def _is_active(cls, name: str) -> bool: """Check if the given reserved name defaults to 1 = active.""" return name not in {"R1", "R2"} @@ -112,7 +112,7 @@ def from_dict(cls, value: Dict[str, bool]) -> "UserAccessPermissions": for name, flag in cls.__members__.items(): if cls._is_reserved(name): # Reserved names have a required value. Use it. - if cls._defaults_to_one(name): + if cls._is_active(name): result |= flag continue is_active = value_copy.pop(name.lower(), False)