Closed oioki closed 4 hours ago
Second attempt of https://github.com/getsentry/sentry/pull/80447
Comparing with the previous attempt, we now also allow project stats for staff users (or user.is_staff).
or user.is_staff
The superuser case is already covered in this code: https://github.com/getsentry/sentry/blob/2e5e0654c717adfa569be7875f44cb7e2bda4a74/src/sentry/api/serializers/models/project.py#L131-L136 is_superuser is True, therefore has_access is True, and the first condition in this snippet works:
is_superuser
has_access
if attrs["has_access"] or user.is_staff:
All modified and coverable lines are covered by tests :white_check_mark:
:white_check_mark: All tests successful. No failed tests found.
Second attempt of https://github.com/getsentry/sentry/pull/80447
Comparing with the previous attempt, we now also allow project stats for staff users (
or user.is_staff
).The superuser case is already covered in this code: https://github.com/getsentry/sentry/blob/2e5e0654c717adfa569be7875f44cb7e2bda4a74/src/sentry/api/serializers/models/project.py#L131-L136
is_superuser
is True, thereforehas_access
is True, and the first condition in this snippet works: