Sage Abdullah
1d0609826d
Simplify publish and edit permissions check in NotificationPreferencesForm
2023-06-19 15:25:02 +01:00
Sage Abdullah
c6f1667e5f
Fix incorrect user_has_any_permission usage
2023-06-19 15:25:02 +01:00
Sage Abdullah
1b4d7902b1
Deprecate wagtail.admin.auth.users_with_page_permission
2023-06-19 15:25:02 +01:00
Sage Abdullah
88ba49b496
Add upgrade considerations for get_pages_with_direct_explore_permission and get_explorable_root_page
2023-06-19 15:25:01 +01:00
Sage Abdullah
cddb2d657a
Deprecate get_explorable_root_page
2023-06-19 15:25:01 +01:00
Sage Abdullah
d4f9f3f9d1
Deprecate get_pages_with_direct_explore_permission
2023-06-19 15:25:01 +01:00
Sage Abdullah
18379f0131
Replace get_explorable_root_page() usage with PagePermissionPolicy.explorable_root_instance()
2023-06-19 15:25:01 +01:00
Sage Abdullah
1b3d6edbf6
Deprecate UserPagePermissionsProxy
2023-06-19 15:25:01 +01:00
Sage Abdullah
91be849e01
Move UserPagePermissionsProxy.revisions_for_moderation() to PagePermissionPolicy
...
This should be deprecated soon as part of the legacy moderation system removal,
but for now we'll move it to the PagePermissionPolicy so we can eliminate
the use of UserPagePermissionsProxy
2023-06-19 15:25:01 +01:00
Sage Abdullah
110f1cf674
Replace remaining UserPagePermissionsProxy usage with PagePermissionPolicy where possible
2023-06-19 15:25:00 +01:00
Sage Abdullah
fa2a64e9d2
Remove user_page_permissions from page's ActionMenuItem
2023-06-19 15:25:00 +01:00
Sage Abdullah
25d9a93798
Remove UserPagePermissionsProxy usage in account settings
2023-06-19 15:25:00 +01:00
Sage Abdullah
0ed63a30b2
Make can_choose_page accept a user instead of UserPagePermissionsProxy object
2023-06-19 15:25:00 +01:00
Sage Abdullah
d15e7b4313
Replace UserPagePermissionsProxy.for_page() with Page.permissions_for_user()
2023-06-19 15:25:00 +01:00
Sage Abdullah
56b678c19e
Detach PagePermissionTester from UserPagePermissionsProxy
2023-06-19 15:25:00 +01:00
Sage Abdullah
54a0ca0044
Add test to assert number of queries for the page edit view as an editor
2023-06-19 15:24:59 +01:00
Sage Abdullah
92510e7f13
Cache explorable root page on user object via PagePermissionPolicy
2023-06-19 15:24:59 +01:00
Sage Abdullah
bacba73b93
Move UserPagePermissionsProxy.explorable_pages logic to PagePermissionPolicy
2023-06-19 15:24:59 +01:00
Sage Abdullah
87af89db05
Move get_explorable_root_page logic to PagePermissionPolicy
2023-06-19 15:24:59 +01:00
Sage Abdullah
4231e33c27
Add first_common_ancestor_of manager method that works with a list of pages instead of a queryset
...
and use it in UserPagePermissionsProxy.explorable_pages
2023-06-19 15:24:59 +01:00
Sage Abdullah
ae07600736
Refactor users_with_page_permission to use PagePermissionPolicy
2023-06-19 15:24:59 +01:00
Sage Abdullah
38368f0f9d
Refactor user_has_any_page_permission to use PagePermissionPolicy
2023-06-19 15:24:58 +01:00
Sage Abdullah
b03296bbe4
Refactor UserPagePermissionsProxy to use PagePermissionPolicy
2023-06-19 15:24:58 +01:00
LB Johnston
96a494581c
Documentation - clean up last two internal refs to use underscore
...
- As per https://docs.wagtail.org/en/latest/contributing/documentation_guidelines.html#reference-links - refs should be `lower_snake_case`
2023-06-19 15:18:02 +01:00
Sage Abdullah
4422e65d25
Release notes for #10470
2023-06-16 11:44:44 +01:00
Sage Abdullah
e2c5a3cf52
Rename BasePermissionPolicy.perm_cache_name to permission_cache_name
...
Also rename _page_perm_cache to _page_permission_cache
2023-06-16 10:22:07 +01:00
Sage Abdullah
7265fee7b4
Fix PagePermissionPolicy's user_has_any_permission and users_with_any_permission to consider implied edit permission from add permission
2023-06-16 10:20:55 +01:00
Sage Abdullah
2462f8c77d
Improve test coverage of PagePermissionPolicy
2023-06-16 09:41:10 +01:00
Sage Abdullah
8cc98c1d12
Simplify PagePermissionPolicy.users_with_any_permission_for_instance query
2023-06-16 09:41:10 +01:00
Sage Abdullah
4e3c7d17f3
Compute edit permission for page owners with add permission in PagePermissionPolicy
2023-06-16 09:41:10 +01:00
Sage Abdullah
56d6e25fae
Make use of descendant_of in PagePermissionTester
2023-06-16 09:41:10 +01:00
Sage Abdullah
28db7624b2
Return permission queryset instead of set in PagePermissionPolicy
2023-06-16 09:41:10 +01:00
Sage Abdullah
041ca6c03b
Add default model argument for PagePermissionProxy
2023-06-16 09:41:09 +01:00
Sage Abdullah
93fc013222
Use precached GroupPagePermission instances to do PagePermissionPolicy queries
2023-06-16 09:41:09 +01:00
Sage Abdullah
193b53af19
Add get_all_permissions_for_user and get_cached_permissions_for_user to BasePermissionPolicy
2023-06-16 09:41:09 +01:00
Sage Abdullah
729363a5fc
Replace exists query with values list for users_with_permission query
...
This prevents crash on Django < 4.0
2023-06-16 09:41:09 +01:00
Sage Abdullah
f541dd9231
Add tests for PagePermissionPolicy
2023-06-16 09:41:09 +01:00
Sage Abdullah
ecfe607e44
Create PagePermissionPolicy with basic GroupPagePermission queries
...
This does not yet take into account more complex logic around advanced
nuances such as ownership and publish permissions.
2023-06-16 09:41:08 +01:00
Thibaud Colas
4848722731
Add new expanded indicator with bottom border for side panel buttons. Fix #9174
2023-06-15 15:53:53 +01:00
Thibaud Colas
abe30d289f
Use the correct width for slim header buttons
2023-06-15 15:53:53 +01:00
Thibaud Colas
284a4ef78e
Move all slim header button classes to be defined in slim_header.html
2023-06-15 15:53:53 +01:00
Thibaud Colas
9285e77734
Allow 2px borders in utility classes
2023-06-15 15:53:53 +01:00
Matt Westcott
840498fc1b
Release note for #10563 in 5.0.2
2023-06-15 12:22:55 +01:00
Matt Westcott
a735265d11
Release note for #10563 in 5.1
2023-06-15 12:22:55 +01:00
LB Johnston
ba8a975273
SyncController - add better performance & enhance
...
- Add support for a default 100ms debounce on apply calls so that multiple events (e.g. keyup) do not impact performance
- Refine the delay for updating the field to not use setTimeout by default as this async behaviour is no longer needed for basic usage
- Add unit tests for debounce functionality and clean up unit testing to ensure each test can run in isolation
- Add explicit tests for non-inpu fields such as select (update code to ensure we use setter not setAttribute to support these)
- Add ability to support an action param for a fixed value being synced to another field
- Relates to #10517
2023-06-15 12:22:55 +01:00
LB Johnston
9c92e394af
Revise default title sync to update on keyup
...
- Previous implementation used keyup to sync the slug with the title field
- Fixes #10517
2023-06-15 12:22:55 +01:00
LB Johnston
fd83bedd72
Docs - fix typo in Django forms reference
2023-06-15 07:52:52 +10:00
Matt Westcott
c16618bc5b
Release note for #10541 in 5.1
2023-06-14 18:51:08 +01:00
Matt Westcott
5757af4f21
Release note for #10541 in 5.0.2
2023-06-14 18:50:43 +01:00
LB Johnston
015c4339d7
Slug Controller - enhance default compare function
...
- Allow compareAs behaviour to be overridden via the event detail OR a param
- Enhance types to be more strict, refine JSDoc to be clearer about the default behaviour
- Add unit tests for default compare function and make logic a bit easier to read in regards to how the slugify/urilify methods are conditionally called
- Relates to #10532
2023-06-14 18:50:43 +01:00