:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'
import { AccessControlLevel, AccessControlResourceType } from '~/types'
// Turning reviews on, the digest, and connecting GitHub need editor. Turning reviews off and changing
// when they run need manager, because those undo or narrow a review decision.
//
// The level comes from the API rather than the app context, because the app context answers for the
// environment in the URL while these rows belong to its parent project. Undefined when no repository
// has loaded yet, which sends the check back to the app context, so a team with no rows can still
// add its first repository.
export function managerDisabledReason(level: AccessControlLevel | undefined): string | null {
return getAccessControlDisabledReason(AccessControlResourceType.Stamphog, AccessControlLevel.Manager, level)
}
export function editorDisabledReason(level: AccessControlLevel | undefined): string | null {
return getAccessControlDisabledReason(AccessControlResourceType.Stamphog, AccessControlLevel.Editor, level)
}