Skip to content

Commit 238208d

Browse files
committed
security fix: CP-36: DNS – Add / Delete Records
1 parent f6fcbe9 commit 238208d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

dns/dnsManager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ def updateRecord(self, userID = None, data = None):
434434

435435
record = Records.objects.get(pk=data['id'])
436436

437+
if ACLManager.VerifyRecordOwner(currentACL, record, zoneDomain) == 1:
438+
pass
439+
else:
440+
return ACLManager.loadErrorJson()
441+
437442
if data['nameNow'] != None:
438443
record.name = data['nameNow']
439444

plogical/acl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ def VerifySMTPHost(currentACL, owner, user):
5353
else:
5454
return 0
5555

56+
@staticmethod
57+
def VerifyRecordOwner(currentACL, record, domain):
58+
if currentACL['admin'] == 1:
59+
return 1
60+
elif record.domainOwner.name == domain:
61+
return 1
62+
else:
63+
return 0
64+
65+
5666
@staticmethod
5767
def AliasDomainCheck(currentACL, aliasDomain, master):
5868
aliasOBJ = aliasDomains.objects.get(aliasDomain=aliasDomain)

0 commit comments

Comments
 (0)