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
16 lines · 652 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 * A value mistyped (`"true"`, `1`) loosens nothing. Only the policy source
10 * is handed in, so a person's settings never reach this.
11 *
12 * @param policy the managed settings, as `$.settings.read` answers them
13 * @returns false only when the organization let a person's plugins override
14 */
15export const denyRulesHold = (policy: Settings) =>
16 ownOption(policy, 'allowModsToOverrideDenyRules') !== true