Skip to content

Commit bdeb07a

Browse files
committed
feat(permission-groups): declare a capability on the organization billing summary read
The merge brought one new operation; the required field refused it until answered. It is an organization-admin surface — admins and owners sit above every group — so it is exempt with its reason on record, and its factory now carries the same definition-time guard the other operation factories do.
1 parent f9f8b01 commit bdeb07a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • apps/sim/lib/billing/application/organization-billing-summary

apps/sim/lib/billing/application/organization-billing-summary/operations.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Principal } from '@sim/auth/principal'
22
import type { ApplicationOperation } from '@/lib/core/application'
3+
import { assertOperationCapability } from '@/lib/core/application'
34

45
export type OrganizationBillingSummaryPrincipal = Extract<Principal, { kind: 'session' }>
56

@@ -13,16 +14,19 @@ export interface OrganizationBillingSummaryOperation<Id extends string = string>
1314
function defineOrganizationBillingSummaryOperation<const Id extends string>(
1415
operation: OrganizationBillingSummaryOperation<Id>
1516
): OrganizationBillingSummaryOperation<Id> {
17+
assertOperationCapability(operation)
1618
Object.freeze(operation.organizationRoles)
1719
Object.freeze(operation.principalKinds)
1820
return Object.freeze(operation)
1921
}
2022

2123
export const organizationBillingSummaryOperations = {
24+
// permission-group-exempt: an organization-admin surface — admins and owners sit above every group, and no group key names organization billing
2225
read: defineOrganizationBillingSummaryOperation({
2326
id: 'organization_billing.summary.read',
2427
organizationRoles: ['admin', 'owner'],
2528
workspaceApiKey: 'deny',
2629
principalKinds: ['session'],
30+
capability: 'none',
2731
}),
2832
} as const

0 commit comments

Comments
 (0)