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.
19 lines
664 B
Python
19 lines
664 B
Python
from django.shortcuts import render
|
|
from django.http.response import HttpResponseNotAllowed
|
|
from django.contrib.auth.decorators import permission_required
|
|
from django.http import HttpResponse
|
|
|
|
# Create your views here.
|
|
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')
|