diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3729e15c38a569c4b77900e151e9fa4271fd3087..81bc036820b18791cc263c9a30c10e63fd1fff12 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 * Route changes in the Legacy-Component iframe didn't trigger a scroll to the top `3.0b3`_ - 2023-03-19 diff --git a/aleksis/core/frontend/components/app/whoAmI.graphql b/aleksis/core/frontend/components/app/whoAmI.graphql index 12235e0ed7c320f46f0442c23e4a75dbba44c6cd..0b2877bd2cf15b5134c8e70978fb6b2218414e3a 100644 --- a/aleksis/core/frontend/components/app/whoAmI.graphql +++ b/aleksis/core/frontend/components/app/whoAmI.graphql @@ -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 diff --git a/aleksis/core/schema/person.py b/aleksis/core/schema/person.py index d5bdb6096b033e4be9a5f3c24565cb695d0e6890..6eed201487348034b2d9b1cba616046b1794dbf2 100644 --- a/aleksis/core/schema/person.py +++ b/aleksis/core/schema/person.py @@ -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( diff --git a/aleksis/core/schema/user.py b/aleksis/core/schema/user.py index 1c1ff08ea2c4c77a6ab68af9e389a36db66a764c..7104a64b6acfa4f0891a9371304df9609569723d 100644 --- a/aleksis/core/schema/user.py +++ b/aleksis/core/schema/user.py @@ -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)