Skip to content

Commit 38b6c3c

Browse files
committed
added get_grouprgiths_by_username
1 parent 014d0f2 commit 38b6c3c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

netdot/Client.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,25 @@ def get_contact_by_username(self, user):
452452
person = self.get_person_by_username(user)
453453
return self.get_contact_by_person_id(person['id'])
454454

455+
def get_grouprights_by_username(self, user):
456+
"""
457+
Returns accessrights for a given username
458+
459+
Arguments:
460+
user -- Netdot Username
461+
462+
Usage:
463+
response = netdot.Client.get_accesrights_by_username("mary")
464+
"""
465+
contacts = self.get_contact_by_username(user)
466+
groupright = {}
467+
print contacts
468+
for values in contacts['Contact'].values():
469+
groupright += self.get_grouprights_by_conlist_id(values['contactlist'])
470+
471+
return groupright
472+
473+
455474
def get_grouprights_by_conlist_id(self, id):
456475
"""
457476
Returns a single-level dict of the requested group's

0 commit comments

Comments
 (0)