CWE-639 · CWE-862
## Summary The `discard` and `edit_redirect` version transitions did not enforce a per-object change-permission check, while the sibling transitions (`archive`, `publish`, `unpublish`, `revert`) all did. As a result a low-privileged staff user could **discard (delete) any draft version — and thereby the underlying content object — of content they have no change permission on**, and could create an editable draft off any published version, by supplying a version primary key they should not have access to (an insecure direct object reference). ## Details Version state transitions are guarded by `Conditions` objects declared on `djangocms_versioning.models.Version`. Every transition that mutates content carries the `user_can_change` condition, which delegates to the *content* object's own permission check (`Version.has_change_permission` → `content.has_change_permission` / `has_placeholder_change_permission`, with a final fallback to the Django `change_<model>` permission). Two conditions were missing that check: ```python # Before (vulnerable) check_discard = Conditions([ in_state([constants.DRAFT], not_draft_error), is_not_locked(lock_error_message), ]) check_edit_redirect = Conditions([ in_state([constants.DRAFT, constants.PUBLISHED], _("Version is not in draft or published state")), draft_is_not_locked(lock_draft_error_message), ]) ``` The corresponding admin views authorize **only** through these conditions: * `VersionAdmin.discard_view` / `Vers