<h1>auth<aclass="headerlink" href="#auth" title="Link to this heading">¶</a></h1>
<p>This page contains tutorials about the <aclass="reference internal" href="../modules/auth.html#module-auth" title="auth"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">auth</span></code></a> package.</p>
<sectionid="naming-convention-on-permissions">
<h2>Naming convention on permissions<aclass="headerlink" href="#naming-convention-on-permissions" title="Link to this heading">¶</a></h2>
<p>Permissions should always start with the full name or short name of the plugin
that defines the permission. This avoids name clashes with other plugins. E.g.
if your plugin is called <codeclass="docutils literal notranslate"><spanclass="pre">admin</span></code> and you want to define the two permissions
<codeclass="docutils literal notranslate"><spanclass="pre">kick</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">ban</span></code>, the names of the permissions should be <codeclass="docutils literal notranslate"><spanclass="pre">admin.kick</span></code>
and <codeclass="docutils literal notranslate"><spanclass="pre">admin.ban</span></code>. This also allows server owners to grant people all
permissions for your plugin by simply using <codeclass="docutils literal notranslate"><spanclass="pre">admin.*</span></code>.</p>
<h2>Check if a player is granted a permission<aclass="headerlink" href="#check-if-a-player-is-granted-a-permission" title="Link to this heading">¶</a></h2>
<p>You can easily check if a player is granted a specific permission by accessing
the <codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">players.entity.Player.permissions</span></code> attribute.</p>
<spanclass="nb">print</span><spanclass="p">(</span><spanclass="s1">'"my_plugin.something" is granted to "</span><spanclass="si">{}</span><spanclass="s1">"?: </span><spanclass="si">{}</span><spanclass="s1">'</span><spanclass="o">.</span><spanclass="n">format</span><spanclass="p">(</span>
<h2>Granting a permission<aclass="headerlink" href="#granting-a-permission" title="Link to this heading">¶</a></h2>
<p>By using the <codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">players.entity.Player.permissions</span></code> attribute you can also