Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Commit

Permalink
rref #5367
Browse files Browse the repository at this point in the history
  • Loading branch information
evrenesat committed Jul 21, 2016
1 parent 5b8ddba commit 74f5633
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ulakbus/models/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,11 @@ def get_permitted_users(self):
User list
"""
users = set()
for ars in self.abstract_role_set:
for r in ars.abstract_role.role_set:
users.add(r.role.user)
for r in self.role_set:
users.add(r.role.user)

for ars in self.abstract_role_set.objects.filter():
for r in ars.role_set.objects.filter():
users.add(r.user)
for r in self.role_set.objects.filter():
users.add(r.user)
return users

def get_permitted_roles(self):
Expand All @@ -113,11 +112,11 @@ def get_permitted_roles(self):
Role list
"""
roles = set()
for ars in self.abstract_role_set:
for r in ars.abstract_role.role_set:
roles.add(r.role)
for r in self.role_set:
roles.add(r.role)
for ars in self.abstract_role_set.objects.filter():
for r in ars.role_set.objects.filter():
roles.add(r)
for r in self.role_set.objects.filter():
roles.add(r)
return roles


Expand Down

0 comments on commit 74f5633

Please sign in to comment.