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

def test_user_cant_add_plugin(self):

    page = self.get_permissions_test_page()
    staff_user = self.get_staff_user_with_no_permissions()
    placeholder = page.placeholders.get(slot='body')
    plugins = placeholder.get_plugins('en').filter(plugin_type='LinkPlugin')
    endpoint = self._get_add_plugin_uri(page)
    self.add_permission(staff_user, 'change_page')
    self.add_permission(staff_user, 'add_link')
    self.add_global_permission(staff_user, can_change=False)
    with self.login_user_context(staff_user):
        data = {'name': 'A    Link', 'external_link': 'https://www.django-cms.org'}
        response = self.client.post(endpoint, data)
        self.assertEqual(response.status_code, 403)
        self.assertEqual(plugins.count(), 0)
