You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
789 B
Python

1 year ago
from django.shortcuts import render
from django.http.response import HttpResponseNotAllowed
from django.contrib.auth.decorators import permission_required
from django.http import HttpResponse
1 year ago
from .models import File
1 year ago
def create_user(request):
special_user = request.user
if special_user.has_perm('abac.can_create_users'):
pass #TODO: Create new User
else:
# Return a response indicating insufficient permissions
return HttpResponseNotAllowed(request)
@permission_required('abac.can_create_users', raise_exception=True)
def create_user_view(request):
# Your view logic here
return HttpResponse('New user created')
1 year ago
def landing_page(request):
files = File.objects.all()
return render(request, 'landing_page.html', {'files': files})