Exemple #1
0
 def dispatch(self, request, *args, **kwargs):
     page = get_object_or_404(Page, pk=kwargs.get('pk', None))
     if permissions.can_user_delete_page(request.user, page):
         return super(DeletePageView, self).dispatch(request, *args, **kwargs)
     else:
         return HttpResponseForbidden('You do not have permission to delete projects.')
Exemple #2
0
def can_delete_page(user, page):
    return permissions.can_user_delete_page(user, page)