canCreateMetric()
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Effective CREATE capability for metrics in a workspace.
export declare function canCreateMetric(workspacePermissions: IWorkspacePermissions, areMetricPermissionsEnabled: boolean): boolean;
Parameters
Parameter | Type | Description |
|---|---|---|
workspacePermissions | the user’s workspace permissions | |
areMetricPermissionsEnabled | boolean | the enableMetricPermissions feature flag |
Returns
boolean
Remarks
Behind enableMetricPermissions the granular CREATE_METRIC permission decides, otherwise the original canManageProject check applies. Drop the branch when the flag is removed.