예제 #1
0
파일: views.py 프로젝트: nikki603/Stars-CMS
 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.')
예제 #2
0
def can_edit_blogpost(user, blogpost):
    return permissions.can_user_edit_blogpost(user, blogpost)