mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 11:26:26 -06:00
Fixes #7814: Fix restriction of user & group objects in GraphQL API queries
This commit is contained in:
parent
8575e465e4
commit
5511ff37c4
@ -22,6 +22,7 @@
|
||||
* [#7802](https://github.com/netbox-community/netbox/issues/7802) - Differentiate ID and VID columns in VLANs table
|
||||
* [#7808](https://github.com/netbox-community/netbox/issues/7808) - Fix reference values for content type under custom field import form
|
||||
* [#7809](https://github.com/netbox-community/netbox/issues/7809) - Add missing export template support for various models
|
||||
* [#7814](https://github.com/netbox-community/netbox/issues/7814) - Fix restriction of user & group objects in GraphQL API queries
|
||||
|
||||
---
|
||||
|
||||
|
@ -19,7 +19,7 @@ class GroupType(DjangoObjectType):
|
||||
|
||||
@classmethod
|
||||
def get_queryset(cls, queryset, info):
|
||||
return RestrictedQuerySet(model=Group)
|
||||
return RestrictedQuerySet(model=Group).restrict(info.context.user, 'view')
|
||||
|
||||
|
||||
class UserType(DjangoObjectType):
|
||||
@ -34,4 +34,4 @@ class UserType(DjangoObjectType):
|
||||
|
||||
@classmethod
|
||||
def get_queryset(cls, queryset, info):
|
||||
return RestrictedQuerySet(model=User)
|
||||
return RestrictedQuerySet(model=User).restrict(info.context.user, 'view')
|
||||
|
Loading…
Reference in New Issue
Block a user