init
This commit is contained in:
commit
ec53fcbe95
1905 changed files with 513762 additions and 0 deletions
35
utils/permissions/PermissionResult.ts
Normal file
35
utils/permissions/PermissionResult.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// Types extracted to src/types/permissions.ts to break import cycles
|
||||
import type {
|
||||
PermissionAllowDecision,
|
||||
PermissionAskDecision,
|
||||
PermissionDecision,
|
||||
PermissionDecisionReason,
|
||||
PermissionDenyDecision,
|
||||
PermissionMetadata,
|
||||
PermissionResult,
|
||||
} from '../../types/permissions.js'
|
||||
|
||||
// Re-export for backwards compatibility
|
||||
export type {
|
||||
PermissionAllowDecision,
|
||||
PermissionAskDecision,
|
||||
PermissionDecision,
|
||||
PermissionDecisionReason,
|
||||
PermissionDenyDecision,
|
||||
PermissionMetadata,
|
||||
PermissionResult,
|
||||
}
|
||||
|
||||
// Helper function to get the appropriate prose description for rule behavior
|
||||
export function getRuleBehaviorDescription(
|
||||
permissionResult: PermissionResult['behavior'],
|
||||
): string {
|
||||
switch (permissionResult) {
|
||||
case 'allow':
|
||||
return 'allowed'
|
||||
case 'deny':
|
||||
return 'denied'
|
||||
default:
|
||||
return 'asked for confirmation for'
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue