<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dagothur</id>
	<title>AlliedModders Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dagothur"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/Special:Contributions/Dagothur"/>
	<updated>2026-06-06T07:55:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Overriding_Command_Access_(SourceMod)&amp;diff=10079</id>
		<title>Overriding Command Access (SourceMod)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Overriding_Command_Access_(SourceMod)&amp;diff=10079"/>
		<updated>2015-11-25T16:50:10Z</updated>

		<summary type="html">&lt;p&gt;Dagothur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article explains how, without editing plugin source code, you can change the flags or permissions on any command, either globally, or for a specific group.&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
Command access overrides are one of the most powerful aspects of the SourceMod administration system.  They effectively let you:&lt;br /&gt;
*Change the access to any admin command without modifying plugin source code;&lt;br /&gt;
*Change the access to entire groups of commands without modifying source code;&lt;br /&gt;
*Create custom access levels;&lt;br /&gt;
*Allow or deny commands and groups of commands to an administrator group regardless of the command flags.&lt;br /&gt;
&lt;br /&gt;
When you change the permissions to a SourceMod object, it is called an ''override''.  An override is an arbitrary string.  If the override string matches a command name, then the command permissions will be inherited from that override.&lt;br /&gt;
&lt;br /&gt;
This concept is important for two reasons:&lt;br /&gt;
*An override can change the permissions of a command.&lt;br /&gt;
*An override can be used as a custom access flag.&lt;br /&gt;
&lt;br /&gt;
For example, a plugin might require access &amp;quot;g&amp;quot; to use the &amp;lt;tt&amp;gt;sm_map&amp;lt;/tt&amp;gt; command.  However, an override could explicitly allow/deny usage of this command to a given group, and/or it could change the default flag for &amp;lt;tt&amp;gt;sm_map&amp;lt;/tt&amp;gt; to be &amp;quot;k&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
More interestingly, a plugin could require &amp;lt;tt&amp;gt;sm_map&amp;lt;/tt&amp;gt; access in order to use a specific menu option.  In this case, a user would have to be able to access &amp;lt;tt&amp;gt;sm_map&amp;lt;/tt&amp;gt;, rather than have a hardcoded flag.&lt;br /&gt;
&lt;br /&gt;
As a final example of the flexibility of this system, a plugin might say that users must be able to access &amp;lt;tt&amp;gt;plugin_crab_usage&amp;lt;/tt&amp;gt;, which isn't a command at all.  Instead, the plugin assumes a ''default'' access level internally, and users can opt to override it as they wish.  This demonstrates that overrides are separate from commands, however, commands themselves inherit their permissions from overrides of the same name.&lt;br /&gt;
&lt;br /&gt;
Changes to the override configuration are not immediate. You can reload overrides by issuing the &amp;quot;sm_reloadadmins&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
=Override Types=&lt;br /&gt;
Overrides come in two flavors: ''command'' overrides and ''command group'' overrides.  Command overrides are overrides that, if they have the same name as a command, that command will automatically inherit that override's permissions.&lt;br /&gt;
&lt;br /&gt;
Similarly, a ''command group'' override is an override that which, if a command has the same group name as a ''command group'' override, that command will inherit the override's permissions.&lt;br /&gt;
&lt;br /&gt;
Example 1: If a command override exists for &amp;lt;tt&amp;gt;sm_map&amp;lt;/tt&amp;gt;, any admin command named &amp;lt;tt&amp;gt;sm_map&amp;lt;/tt&amp;gt; will inherit those permissions.&lt;br /&gt;
&lt;br /&gt;
Example 2: If a command group override exists for &amp;lt;tt&amp;gt;CSDM&amp;lt;/tt&amp;gt;, any admin command labelled as a &amp;quot;CSDM&amp;quot; command will inherit those permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Global Configuration=&lt;br /&gt;
Access levels for overrides can be globally reconfigured via &amp;lt;tt&amp;gt;configs/admin_overrides.cfg&amp;lt;/tt&amp;gt;.  The file format is very simple:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Overrides&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;[name1]&amp;quot;	&amp;quot;[flags]&amp;quot;&lt;br /&gt;
	&amp;quot;@[group1]&amp;quot;	&amp;quot;[flags]&amp;quot;&lt;br /&gt;
	/* ... */&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Command groups are specified with an 'at' sign ('@') preceding the name.  Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Overrides&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;sm_map&amp;quot;	&amp;quot;k&amp;quot;	//Change &amp;quot;sm_map&amp;quot; to the &amp;quot;k&amp;quot; flag.&lt;br /&gt;
	&amp;quot;@CSDM&amp;quot;		&amp;quot;m&amp;quot;	//Change all CSDM commands to the &amp;quot;m&amp;quot; flag.&lt;br /&gt;
	&amp;quot;sm_chat&amp;quot;	&amp;quot;&amp;quot;	//Allow anyone to use &amp;quot;sm_chat&amp;quot;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that given an arbitrary number of flags, the client must require access to '''all''' specified flags in the string, as opposed to just any one of them.&lt;br /&gt;
&lt;br /&gt;
=Group Configuration=&lt;br /&gt;
Group overrides are given on an allow or deny basis.  That is, rather than changing flags per-group, the override is simply whether it is allowed or denied to members of that group.  &lt;br /&gt;
&lt;br /&gt;
For more information, visit [[Adding_Groups_%28SourceMod%29#File_Format|Adding Groups]].&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Documentation]]&lt;br /&gt;
&lt;br /&gt;
{{LanguageSwitch}}&lt;/div&gt;</summary>
		<author><name>Dagothur</name></author>
		
	</entry>
</feed>