Note: disabled rules are excluded.
558970
@CheckForNull
  public ActiveRule getActiveRuleByConfigKey(String repositoryKey, String configKey) {
    for (ActiveRule activeRule : activeRules) {
      if (StringUtils.equals(activeRule.getRepositoryKey(), repositoryKey) && StringUtils.equals(activeRule.getConfigKey(), configKey) && activeRule.isEnabled()) {
        return activeRule;
      }
    }
    return null;
  }
61533
def add_exclusion(self, role, value):
        

        self._add_rule(self.excludes, role, value)
997320
public function isDisabled()
    {
        if ($page = $this->getCurrentPage(Page::class)) {
            
            if ($this->getLevel()) {
                return parent::isDisabled();
            }
            
        }
        
        return true;
    }
934469
function createDisabledPseudo( disabled ) {

	// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
	return function( elem ) {

		// Only certain elements can match :enabled or :disabled
		// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
		// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
		if ( "form" in elem ) {

			// Check for inherited disabledness on relevant non-disabled elements:
			// * listed form-associated elements in a disabled fieldset
			//   https://html.spec.whatwg.org/multipage/forms.html#category-listed
			//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
			// * option elements in a disabled optgroup
			//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
			// All such elements have a "form" property.
			if ( elem.parentNode && elem.disabled === false ) {

				// Option elements defer to a parent optgroup if present
				if ( "label" in elem ) {
					if ( "label" in elem.parentNode ) {
						return elem.parentNode.disabled === disabled;
					} else {
						return elem.disabled === disabled;
					}
				}

				// Support: IE 6 - 11
				// Use the isDisabled shortcut property to check for disabled fieldset ancestors
				return elem.isDisabled === disabled ||

					// Where there is no isDisabled, check manually
					/* jshint -W018 */
					elem.isDisabled !== !disabled &&
						inDisabledFieldset( elem ) === disabled;
			}

			return elem.disabled === disabled;

		// Try to winnow out elements that can't be disabled before trusting the disabled property.
		// Some victims get caught in our net (label, legend, menu, track), but it shouldn't
		// even exist on them, let alone have a boolean value.
		} else if ( "label" in elem ) {
			return elem.disabled === disabled;
		}

		// Remaining elements are neither :enabled nor :disabled
		return false;
	};
}
838148
public void setDisabled(boolean disabled) {
		this.disabled = disabled;
		if (disabled) {
			handlerManager.fireEvent(new ToolbarActionDisabledEvent());
		} else {
			handlerManager.fireEvent(new ToolbarActionEnabledEvent());
		}
	}
646482
@RequirePOST
    public void doDisable(StaplerRequest req, StaplerResponse rsp) throws IOException {
        disable(true);
        rsp.sendRedirect2(req.getContextPath()+"/manage");
    }
920006
function() {
      
      this.disabled = false;
      
      Dom.removeClass(this.el,"inputEx-Button-disabled");
      
      if (this.options.type === "submit") {
         this.el.disabled = false;
      }
   }
444438
private void addDisabledExamples() {
		add(new WHeading(HeadingLevel.H2, "Examples of disabled buttons"));

		WPanel disabledButtonLayoutPanel = new WPanel(WPanel.Type.BOX);
		disabledButtonLayoutPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0,
				FlowLayout.ContentAlignment.BASELINE));
		add(disabledButtonLayoutPanel);

		WButton button = new WButton("Disabled button");
		button.setDisabled(true);
		disabledButtonLayoutPanel.add(button);
		button = new WButton("Disabled button as link");
		button.setDisabled(true);
		button.setRenderAsLink(true);
		disabledButtonLayoutPanel.add(button);

		add(new WHeading(HeadingLevel.H3, "Examples of disabled buttons displaying only an image"));
		disabledButtonLayoutPanel = new WPanel(WPanel.Type.BOX);
		disabledButtonLayoutPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0,
				FlowLayout.ContentAlignment.BASELINE));
		add(disabledButtonLayoutPanel);

		button = new WButton("Disabled button");
		button.setDisabled(true);
		button.setImage("/image/tick.png");
		button.setToolTip("Checking currently disabled");
		disabledButtonLayoutPanel.add(button);
		button = new WButton("Disabled button as link");
		button.setDisabled(true);
		button.setRenderAsLink(true);
		button.setImage("/image/tick.png");
		button.setToolTip("Checking currently disabled");
		disabledButtonLayoutPanel.add(button);

		add(new WHeading(HeadingLevel.H3,
				"Examples of disabled buttons displaying an image with imagePosition EAST"));

		disabledButtonLayoutPanel = new WPanel(WPanel.Type.BOX);
		disabledButtonLayoutPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0,
				FlowLayout.ContentAlignment.BASELINE));
		add(disabledButtonLayoutPanel);
		button = new WButton("Disabled button");
		button.setDisabled(true);
		button.setImage("/image/tick.png");
		button.setToolTip("Checking currently disabled");
		button.setImagePosition(ImagePosition.EAST);
		disabledButtonLayoutPanel.add(button);
		button = new WButton("Disabled button as link");
		button.setDisabled(true);
		button.setRenderAsLink(true);
		button.setImage("/image/tick.png");
		button.setToolTip("Checking currently disabled");
		button.setImagePosition(ImagePosition.EAST);
		disabledButtonLayoutPanel.add(button);
	}
1319556
public boolean removePolicy(String sec, String ptype, List<String> rule) {
        for (int i = 0; i < model.get(sec).get(ptype).policy.size(); i ++) {
            List<String> r = model.get(sec).get(ptype).policy.get(i);
            if (Util.arrayEquals(rule, r)) {
                model.get(sec).get(ptype).policy.remove(i);
                return true;
            }
        }

        return false;
    }
56278
function postprocessForDisableRules(messages, microTemplateService) {
    const option = microTemplateService.systemOption || {}
    const ignoreRules = DISABLED_RULES.concat(option.ignoreRules || [])
    const globals = GLOBALS.concat(option.globals || [])

    return messages.filter(message => {
        if (ignoreRules.indexOf(message.ruleId) >= 0) {
            return false
        }
        if (
            microTemplateService.inTemplate(message) &&
            TEMPLATE_DISABLED_RULES.indexOf(message.ruleId) >= 0
        ) {
            return false
        }
        if (
            microTemplateService.inInterpolateOrEscape(message) &&
            TMPL_INTERPOLATE_DISABLED_RULES.indexOf(message.ruleId) >= 0
        ) {
            return false
        }
        if (
            microTemplateService.inDelimiterMarks(message) &&
            TMPL_DELIMITERS_DISABLED_RULES.indexOf(message.ruleId) >= 0
        ) {
            return false
        }

        if (message.ruleId === "no-undef") {
            if (
                globals
                    .map(g => `'${g}' is not defined.`)
                    .indexOf(message.message) >= 0
            ) {
                return false
            }
        }
        if (message.ruleId === "quotes") {
            if (message.message === "Strings must use doublequote.") {
                return false
            }
        }

        return true
    })
}
480333
function(opts, fm) {
				if (fm.UA.Mobile || fm.UA.ltIE8) {
					this.disabled = true;
				}
			}
900843
public void setHideDisabled(final boolean hideDisabled) {
        if (hideDisabled)
            attrMixin.setAttribute(HIDE_DISABLED, Boolean.toString(true));
        else
            attrMixin.removeAttribute(HIDE_DISABLED);
    }
1274381
public void disable(String disabledReason) {

        setDown(false);
        setEnabled(false);
        m_disabledReason = disabledReason;
        super.setTitle(disabledReason);
    }
845917
function() {
		if (insertCounter === 3) {
			insertBtn.disabled = true;
		}
		else {
			insertBtn.disabled = false;
		}
		
		if (insertCounter === -3) {
			removeBtn.disabled = true;
		}
		else {
			removeBtn.disabled = false;
		}
	}
369556
def is_allowed(self, subject_id, action, resource_id, policy_sets=[]):
        
        body = {
            "action": action,
            "subjectIdentifier": subject_id,
            "resourceIdentifier": resource_id,
        }

        if policy_sets:
            body['policySetsEvaluationOrder'] = policy_sets

        # Will return a 200 with decision
        uri = self.uri + '/v1/policy-evaluation'

        logging.debug("URI=" + str(uri))
        logging.debug("BODY=" + str(body))

        response = self.service._post(uri, body)

        if 'effect' in response:
            if response['effect'] in ['NOT_APPLICABLE', 'PERMIT']:
                return True

        return False
905118
public function setDisabled($disabled)
    {
        if ($disabled) {
            $this->setAttribute('disabled', 'disabled');
        } else {
            $this->removeAttribute('disabled');
        }
        return parent::setDisabled($disabled);
    }
114108
protected void addAllowedOuCondition(
        CmsSelectQuery select,
        TableAlias users,
        List<CmsOrganizationalUnit> allowedOus) {

        if ((allowedOus != null) && !allowedOus.isEmpty()) {
            CmsCompositeQueryFragment ouCondition = new CmsCompositeQueryFragment();
            ouCondition.setPrefix("(");
            ouCondition.setSuffix(")");
            ouCondition.setSeparator(" OR ");
            for (CmsOrganizationalUnit ou : allowedOus) {
                String ouName = CmsStringUtil.joinPaths("/", ou.getName());
                ouCondition.add(new CmsSimpleQueryFragment(users.column(colOu()) + " = ? ", ouName));
            }
            select.addCondition(ouCondition);
        }
    }