'User can\'t add page permissions if he
does not have change permissions on the Page model,
does not have add permissions on the PagePermission model,
does not have global change permission,
and/or does not have global change permissions permission.'

def test_user_cant_add_page_permissions(self):

    admin = self.get_superuser()
    page = self.get_permissions_test_page()
    endpoint = (self.get_admin_url(Page, 'permissions', page.pk) + '?language=en')
    staff_user = self.get_staff_user_with_no_permissions()
    staff_user_2 = self.get_staff_page_user(created_by=admin)
    data = self._get_page_permissions_data(page=page.pk, user=staff_user_2.pk)
    data['_continue'] = '1'
    self.add_permission(staff_user, 'change_page')
    self.add_permission(staff_user, 'add_pagepermission')
    self.add_global_permission(staff_user, can_change=True, can_change_permissions=False)
    with self.login_user_context(staff_user):
        response = self.client.post(endpoint, data)
        self.assertEqual(response.status_code, 403)
        self.assertFalse(self._page_permission_exists(user=staff_user_2))
