mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
9856 update types
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
from typing import List
|
||||
|
||||
import strawberry
|
||||
import strawberry_django
|
||||
from django.contrib.auth import get_user_model
|
||||
@ -36,3 +38,7 @@ class UserType:
|
||||
@classmethod
|
||||
def get_queryset(cls, queryset, info, **kwargs):
|
||||
return RestrictedQuerySet(model=get_user_model()).restrict(info.context.request.user, 'view')
|
||||
|
||||
@strawberry_django.field
|
||||
def groups(self) -> List[GroupType]:
|
||||
return self.groups.all()
|
||||
|
Reference in New Issue
Block a user