Skip to content

Commit

Permalink
Use permission_required decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman committed Feb 27, 2013
1 parent b5a6ec4 commit 6516ec0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions boxes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
from django.utils import timezone
from django.views.decorators.http import require_POST

from django.contrib.auth.decorators import permission_required

from boxes.forms import BoxForm
from boxes.models import Box


@require_POST
@permission_required("boxes.change_box", raise_exception=True)
def box_edit(request, label):

if not request.user.has_perm("boxes.change_box"):
return HttpResponseForbidden()

next = request.GET.get("next")

Expand Down

0 comments on commit 6516ec0

Please sign in to comment.