from django.contrib import auth
from django.contrib.auth.models import User
-from django.contrib.auth.decorators import login_required
+from django.contrib.auth.decorators import login_required, permission_required
from django.core.urlresolvers import reverse
from django.db.models import Count, Q
from django import http
return http.HttpResponseRedirect(urlquote_plus(request.GET.get('next', '/'), safe='/?='))
+@permission_required('catalogue.add_book')
@active_tab('create')
def create_missing(request, slug=None):
if slug is None:
})
+@permission_required('catalogue.add_book')
@active_tab('upload')
def upload(request):
if request.method == "POST":
})
+@permission_required('catalogue.add_chunk')
def chunk_add(request, slug, chunk):
try:
doc = Chunk.get(slug, chunk)
})
+@permission_required('catalogue.change_book')
def book_append(request, slug):
book = get_object_or_404(Book, slug=slug)
if request.method == "POST":
})
+@permission_required('catalogue.change_book')
def book_edit(request, slug):
book = get_object_or_404(Book, slug=slug)
if request.method == "POST":