Add upgrade considerations for get_pages_with_direct_explore_permission and get_explorable_root_page

pull/10562/head
Sage Abdullah 2023-06-14 15:27:25 +01:00
rodzic cddb2d657a
commit 88ba49b496
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: EB1A33CC51CC0217
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -109,3 +109,7 @@ permission_policy.user_has_any_permission(user, "unlock")
The `UserPagePermissionsProxy` object that was previously available in page's `ActionMenuItem` context as `user_page_permissions` has been removed. In cases where the page object is available (e.g. the page edit view), the `PagePermissionTester` object stored as the `user_page_permissions_tester` context variable is still available.
If you use `UserPagePermissionsProxy` in your code, e.g. the `user_page_permissions` context variable in an `ActionMenuItem` subclass as part of your `register_page_action_menu_item` hooks, make sure to replace it either with the `PagePermissionTester` or the `PagePermissionPolicy` equivalent.
### `get_pages_with_direct_explore_permission` and `get_explorable_root_page` are deprecated
The undocumented `get_pages_with_direct_explore_permission` and `get_explorable_root_page` functions in `wagtail.admin.navigation` are deprecated. They can be replaced with `PagePermissionPolicy().instances_with_direct_explore_permission(user)` and `PagePermissionPolicy().explorable_root_instance(user)`, respectively.