Set a capability as enabled/disabled.

@param array $capability  A capability (+ parameter).
@param boolean $enable    If true, enables the capability.
556935
public function enable($capability, $enable = true)
    {
        $capability = Horde_String::upper($capability);
        $enabled = $this->isEnabled($capability);

        if ($enable && !$enabled) {
            switch ($capability) {
            case 'QRESYNC':
                /* RFC 7162 [3.2.3] - Enabling QRESYNC also implies enabling
                 * of CONDSTORE. */
                $this->enable('CONDSTORE');
                break;
            }

            $this->_enabled[] = $capability;
            $this->notify();
        } elseif (!$enable && $enabled) {
            $this->_enabled = array_diff($this->_enabled, array($capability));
            $this->notify();
        }
    }
1363609
public function setDisabled(bool $disabled) : Element
    {
        if ($disabled) {
            $this->getTag()->setAttribute('disabled', 'disabled');
        } else {
            $this->getTag()->removeAttribute('disabled');
        }

        return $this;
    }
1180448
public void setBoardEnabled(boolean enable) {
        if (mEnabled != enable) {
            if (DBG) Log.v(TAG, "enable - " + enable);
            mEnabled = enable;
        }
    }
1069106
public function query($capability, $parameter = null)
    {
        $capability = Horde_String::upper($capability);

        if (!isset($this->_data[$capability])) {
            return false;
        }

        return is_null($parameter) ?:
               (is_array($this->_data[$capability]) &&
                in_array(Horde_String::upper($parameter), $this->_data[$capability]));
    }
558718
public void setEnabled(boolean enabled) {
		super.setEnabled(enabled);
		comboBox.setEnabled(enabled);

		if (spinner != null) {
			spinner.setEnabled(enabled);
		}
	}
439613
public function includeInactive($enable = true)
    {
        $this->includeInactive = (bool) $enable;

        $this->refreshSettingDependentCriteria();

        return $this;
    }
701133
public function setDisabled($disabled)
    {
        $this->disabled = (bool) $disabled;

        if ($this->disabled) {
            $this->attributes = $this->attributes->reject(function ($value, $key) {
                return Str::startsWith($key, ['data-']);
            });
        }

        return $this;
    }
505374
public function user_can( $capability = null ) {
		if ( ! isset( $capability ) ) {
			$capability = $this->app->get_config( 'capability', 'default_user', 'manage_options' );
		}
		if ( false === $capability ) {
			return true;
		}
		if ( '' === $capability ) {
			return false;
		}

		return $this->has_cap( $capability ) || in_array( $capability, $this->user_roles );
	}
455698
public void setEnabled(boolean enabled) {

        if (enabled) {
            enable();
        } else {
            m_button.setEnabled(enabled);
            getElement().setPropertyBoolean("disabled", true);
        }
    }
838148
public void setDisabled(boolean disabled) {
		this.disabled = disabled;
		if (disabled) {
			handlerManager.fireEvent(new ToolbarActionDisabledEvent());
		} else {
			handlerManager.fireEvent(new ToolbarActionEnabledEvent());
		}
	}
644268
public function has_capability($capability, $userid = null, $doanything = true) {
        return $this->quizobj->has_capability($capability, $userid, $doanything);
    }
220738
public function setEnabled(Enabled $enabled)
    {
        $levels = false === $enabled->value() ?
            new PhpCsFixerLevels(
                new Level(false),
                new Level(false),
                new Level(false),
                new Level(false)
            ) : $this->levels;

        return new self(
            new Undefined(false),
            $enabled,
            $levels,
            $this->options
        );
    }
164529
public static function set($actionName = null, $enable) {
        $actionName = ($actionName === null ? '.' : $actionName);

        if ($actionName != '.' && !self::$actionContext->actionNameEquals($actionName)) {
            return;
        }

        self::$enable = $enable;
    }
570955
public function setSiteSpecificUserAgentExcludeEnabled($enabled)
    {
        Piwik::checkUserHasSuperUserAccess();

        // update option
        Option::set(self::OPTION_SITE_SPECIFIC_USER_AGENT_EXCLUDE_ENABLE, $enabled);

        // make sure tracker cache will reflect change
        Cache::deleteTrackerCache();
    }
401334
public function set_supports( $support ) {
		if ( is_array( $support ) ) {
			$this->supports = $support;
			$this->update_arg( 'supports', $this->supports );
		}
	}
1242876
public function set_threading($enable = false)
    {
        $this->threading = false;

        if ($enable && ($caps = $this->get_capability('THREAD'))) {
            $methods = array('REFS', 'REFERENCES', 'ORDEREDSUBJECT');
            $methods = array_intersect($methods, $caps);

            $this->threading = array_shift($methods);
        }

        return $this->threading;
    }
66151
public void setEnabled(boolean enabled)
	{
		if (isEnabled() == enabled)
			return;

		if (!fireEvent(new DisabledStateChange<>(this, enabled)))
			return;

		this.enabled = enabled;
		if (enabled)
		{
			setHovered(false);
			setFocused(false);
		}
	}