0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00

Give staff flamegraph access on cloud (#5869)

This commit is contained in:
Karl-Aksel Puulmann 2021-09-09 10:59:40 +03:00 committed by GitHub
parent a8f46b056b
commit afe5c59831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,8 @@ import {
SystemStatusQueriesResult,
SystemStatusAnalyzeResult,
OrganizationType,
UserType,
PreflightStatus,
} from '~/types'
import { preflightLogic } from 'scenes/PreflightCheck/logic'
import { organizationLogic } from 'scenes/organizationLogic'
@ -94,9 +96,17 @@ export const systemStatusLogic = kea<systemStatusLogicType<TabName>>({
(status: SystemStatus | null): SystemStatusRow[] => (status ? status.overview : []),
],
showAnalyzeQueryButton: [
() => [organizationLogic.selectors.currentOrganization],
(org: OrganizationType | null): boolean =>
!!org?.membership_level && org.membership_level >= OrganizationMembershipLevel.Admin,
() => [
preflightLogic.selectors.preflight,
organizationLogic.selectors.currentOrganization,
userLogic.selectors.user,
],
(preflight: PreflightStatus | null, org: OrganizationType | null, user: UserType | null): boolean => {
if (preflight?.cloud) {
return !!user?.is_staff
}
return !!org?.membership_level && org.membership_level >= OrganizationMembershipLevel.Admin
},
],
}),