kopia lustrzana https://github.com/wagtail/wagtail
Update upgrade considerations regarding user_page_permissions
rodzic
be81209b43
commit
09ea58b53b
|
@ -106,9 +106,11 @@ permission_policy.instances_user_has_permission_for(user, "publish").exists()
|
|||
permission_policy.user_has_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.
|
||||
The `UserPagePermissionsProxy` object that is available in page's `ActionMenuItem` context as `user_page_permissions` (which might be used as part of a `register_page_action_menu_item` hook) has been deprecated. 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 can still be used.
|
||||
|
||||
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.
|
||||
The `UserPagePermissionsProxy` object that is available in the template context as `user_page_permissions` as a side-effect of the `page_permissions` template tag has also been deprecated.
|
||||
|
||||
If you use the `user_page_permissions` context variable or use the `UserPagePermissionsProxy` class directly, make sure to replace it either with the `PagePermissionTester` or the `PagePermissionPolicy` equivalent.
|
||||
|
||||
### `get_pages_with_direct_explore_permission`, `get_explorable_root_page`, and `users_with_page_permission` are deprecated
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue