MCPcopy
hub / github.com/PostHog/posthog / get_object

Method get_object

posthog/api/user.py:211–222  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

209 lookup_field = "uuid"
210
211 def get_object(self) -> User:
212 lookup_value = self.kwargs[self.lookup_field]
213 request_user = cast(User, self.request.user) # Must be authenticated to access this endpoint
214 if lookup_value == "@me":
215 return request_user
216
217 if not request_user.is_staff:
218 raise exceptions.PermissionDenied(
219 "As a non-staff user you're only allowed to access the `@me` user instance."
220 )
221
222 return super().get_object()
223
224 def get_queryset(self):
225 queryset = super().get_queryset()

Callers 15

has_permissionMethod · 0.45
wrapperFunction · 0.45
read_bytesMethod · 0.45
retrieveMethod · 0.45
error_detailsMethod · 0.45
personsMethod · 0.45
contentMethod · 0.45
verifyMethod · 0.45
retrieveMethod · 0.45
viewedMethod · 0.45
contentMethod · 0.45
countMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected