Beispiel #1
0
 def render_to_response(self, context):
     if permissions.can_user_edit_blogpost(self.request.user, context['blog']):
         return UpdateView.render_to_response(self, context)
     else:
         return HttpResponseForbidden('You do not have permission to edit this blog post.')
Beispiel #2
0
def can_edit_blogpost(user, blogpost):
    return permissions.can_user_edit_blogpost(user, blogpost)