Skip to content

Commit

Permalink
add owner protection for reseller center
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Feb 18, 2020
2 parents c683ef3 + 25ef1dd commit 266cfc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions userManagment/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,9 +908,16 @@ def saveResellerChanges(request):
else:
return ACLManager.loadErrorJson()

loggedUser = Administrator.objects.get(pk=val)

userToBeModified = Administrator.objects.get(userName=data['userToBeModified'])
newOwner = Administrator.objects.get(userName=data['newOwner'])

### Check user owners

if ACLManager.checkUserOwnerShip(currentACL, loggedUser, userToBeModified) == 0 or ACLManager.checkUserOwnerShip(currentACL, loggedUser, newOwner) == 0:
return ACLManager.loadErrorJson()

try:
if ACLManager.websitesLimitCheck(newOwner, data['websitesLimit'], userToBeModified) == 0:
finalResponse = {'status': 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,4 @@ a:hover {

.btn-min-width {
min-width: 300px;
}
}

0 comments on commit 266cfc8

Please sign in to comment.