spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / hooks / policy / deny-rules-hold.ts
17 lines · 711 BRaw
1import type { Settings } from 'claude-code'
2
3import { ownOption } from './own-option'
4
5/**
6 * Whether deny rules hold over the plugins a person installs: they do unless
7 * managed policy sets `allowModsToOverrideDenyRules` to the literal `true`.
8 *
9 * Every other deny, and ask rules, hold or not with them. A value mistyped
10 * (`"true"`, `1`) loosens nothing. Only the policy source is handed in, so a
11 * person's settings never reach this.
12 *
13 * @param policy the managed settings, as `$.settings.read` answers them
14 * @returns false only when the organization let a person's plugins override
15 */
16export const denyRulesHold = (policy: Settings) =>
17 ownOption(policy, 'allowModsToOverrideDenyRules') !== true