Skip to content
Snippets Groups Projects
Commit cc82524e authored by Julian's avatar Julian
Browse files

Fix usertype schema to reenable `stop impersonation` button

parent 8aedf7bb
No related branches found
No related tags found
3 merge requests!1237Release 3.0,!1213Resolve "`Stop impersonation` Button missing",!1183Release 3.0
Pipeline #122241 failed
......@@ -28,6 +28,7 @@ Fixed
* 404 page was sometimes shown while the page was still loading.
* Setting of page height in the iframe was not working correctly.
* App switched to offline state when the user was logged out/in.
* The `Stop Impersonation` button is not shown due to an oversee when changing the type of the whoAmI query to an object of UserType
`3.0b3`_ - 2023-03-19
---------------------
......
......@@ -3,6 +3,7 @@ query ($permissions: [String]!) {
username
isAuthenticated
isAnonymous
isImpersonate
person {
photo {
url
......@@ -10,7 +11,6 @@ query ($permissions: [String]!) {
fullName
avatarUrl
isDummy
isImpersonate
}
permissions: globalPermissionsByName(permissions: $permissions) {
name
......
......@@ -10,7 +10,7 @@ from guardian.shortcuts import get_objects_for_user
from ..forms import PersonForm
from ..models import DummyPerson, Person
from ..util.core_helpers import get_site_preferences, has_person, is_impersonate
from ..util.core_helpers import get_site_preferences, has_person
from .base import FieldFileType
from .notification import NotificationType
......@@ -65,7 +65,6 @@ class PersonType(DjangoObjectType):
unread_notifications_count = graphene.Int()
is_dummy = graphene.Boolean()
is_impersonate = graphene.Boolean()
preferences = graphene.Field(PersonPreferencesType)
can_edit_person = graphene.Boolean()
......@@ -199,9 +198,6 @@ class PersonType(DjangoObjectType):
def resolve_is_dummy(root: Union[Person, DummyPerson], info, **kwargs):
return root.is_dummy if hasattr(root, "is_dummy") else False
def resolve_is_impersonate(root: Person, info, **kwargs):
return is_impersonate(info.context)
def resolve_notifications(root: Person, info, **kwargs):
if has_person(info.context.user) and info.context.user.person == root:
return root.notifications.filter(send_at__lte=timezone.now()).order_by(
......
......@@ -12,6 +12,7 @@ class UserType(graphene.ObjectType):
is_authenticated = graphene.Boolean(required=True)
is_anonymous = graphene.Boolean(required=True)
is_impersonate = graphene.Boolean()
person = graphene.Field(PersonType)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment