Commit 7ddca5dd authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Readd services property

parent 50d4f165
......@@ -102,6 +102,19 @@ class User(AbstractUser):
'ssh_key': self.ssh_keys.all(),
}
# services returns all services this user has access to
@property
def services(self):
queryset = None
for vo in self.vos.all():
if queryset is None:
queryset = vo.services.all()
else:
queryset.union(vo.services.all())
return queryset
@property
def is_active_at_clients(self):
return self._is_active
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment