예제 #1
0
파일: views.py 프로젝트: nikki603/Stars-CMS
    def dispatch(self, request, *args, **kwargs):
        member = get_object_or_404(Member, pk=kwargs.get('pk', None))

        if permissions.can_user_edit_member(request.user, member):
            return super(EditProfileView, self).dispatch(request, *args, **kwargs)
        else:
            return HttpResponseForbidden('You do not have permission to edit this profile.')
예제 #2
0
def can_edit_member(user, member):
    return permissions.can_user_edit_member(user, member)