mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #7814: Fix restriction of user & group objects in GraphQL API queries
This commit is contained in:
parent
9f8068e8d1
commit
daf6c8e327
@ -22,6 +22,7 @@
|
|||||||
* [#7802](https://github.com/netbox-community/netbox/issues/7802) - Differentiate ID and VID columns in VLANs table
|
* [#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
|
* [#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
|
* [#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
|
@classmethod
|
||||||
def get_queryset(cls, queryset, info):
|
def get_queryset(cls, queryset, info):
|
||||||
return RestrictedQuerySet(model=Group)
|
return RestrictedQuerySet(model=Group).restrict(info.context.user, 'view')
|
||||||
|
|
||||||
|
|
||||||
class UserType(DjangoObjectType):
|
class UserType(DjangoObjectType):
|
||||||
@ -34,4 +34,4 @@ class UserType(DjangoObjectType):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_queryset(cls, queryset, info):
|
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