Esempio n. 1
0
 def dispatch(self, request, *args, **kwargs):
     member = get_object_or_404(Member, pk=kwargs.get('pk', None))
     if permissions.can_user_delete_member(request.user, member):
         return super(DeleteMemberView, self).dispatch(request, *args, **kwargs)
     else:
         return HttpResponseForbidden('You do not have permission to delete members.')
Esempio n. 2
0
def can_delete_member(user, member):
    return permissions.can_user_delete_member(user, member)