mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
add can_unschedule to PagePermissionTester
This commit is contained in:
parent
254092e595
commit
3e1511d362
@ -1154,7 +1154,7 @@ def revisions_unschedule(request, page_id, revision_id):
|
||||
page = get_object_or_404(Page, id=page_id).specific
|
||||
|
||||
user_perms = UserPagePermissionsProxy(request.user)
|
||||
if not user_perms.for_page(page).can_publish():
|
||||
if not user_perms.for_page(page).can_unschedule():
|
||||
raise PermissionDenied
|
||||
|
||||
revision = get_object_or_404(page.revisions, id=revision_id)
|
||||
|
@ -1759,6 +1759,9 @@ class PagePermissionTester:
|
||||
def can_set_view_restrictions(self):
|
||||
return self.can_publish()
|
||||
|
||||
def can_unschedule(self):
|
||||
return self.can_publish()
|
||||
|
||||
def can_lock(self):
|
||||
return self.user.is_superuser or ('lock' in self.permissions)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user