Skip to content
Permalink
Browse files
security check for user creation
  • Loading branch information
usmannasir committed Jan 21, 2020
1 parent ec644f1 commit 27562930461a88e761ecc2b54e0497dbcc43232d
Showing with 7 additions and 2 deletions.
  1. +7 −2 userManagment/views.py
@@ -91,7 +91,6 @@ def apiAccess(request):
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return redirect(loadLoginPage)


def saveChangesAPIAccess(request):
try:
userID = request.session['userID']
@@ -123,7 +122,6 @@ def saveChangesAPIAccess(request):
json_data = json.dumps(finalResponse)
return HttpResponse(json_data)


def submitUserCreation(request):
try:

@@ -200,6 +198,13 @@ def submitUserCreation(request):
newAdmin.save()
elif currentACL['createNewUser'] == 1:

if selectedACL != 'user':
data_ret = {'status': 0, 'createStatus': 0,
'error_message': "You are not authorized to access this resource."}

final_json = json.dumps(data_ret)
return HttpResponse(final_json)

newAdmin = Administrator(firstName=firstName,
lastName=lastName,
email=email,

0 comments on commit 2756293

Please sign in to comment.