<p>I've just updated <a href="https://verbb.io/craft-plugins/comments/docs/get-started/configuration#permissions" rel="nofollow noreferrer">the docs</a>, but because it uses the UID of element &quot;groups&quot; it might be annoying in practice to use the config file to set this up, as it requires a bit of manual looking-up of these values.</p>
<p>As the plugin settings are stored in Project Config, you'll probably get the same value setting it through the control panel.</p>
<pre class="lang-php prettyprint-override"><code>'permissions' =&gt; [
    'craft\elements\Asset' =&gt; [
        // Volume UIDs
        '33974e79-b3b6-47ec-af91-4519fe4985be',
        'c194716f-aa74-40b6-8426-c835599cbe93',
    ],

    'craft\elements\Category' =&gt; [
        // Category Group UIDs
        'a27827c8-4810-433c-acb9-261b53d46281',
        '346194f0-6da8-4f46-a20b-795631ee9a5f',
    ],

    'craft\elements\Entry' =&gt; [
        // Section UIDs
        'a8d4bdf1-164e-4ddc-aaad-640026b8d3bf',
    ],

    'craft\elements\User' =&gt; [
        // User Group UIDs
        'c23a4d8d-47f0-4e71-927c-d5897ec9c9f8',
    ],
],
</code></pre>

CC BY-SA 4.0
2021-05-17T11:46:51.537Z
Thanks @crawf! Relying on project config makes sense. We like the idea of using the PHP config file though. We are disabling admin setting changes outside local environments (i.e. no UI for comments settings in staging or prod) and think it's easier for devs to lookup configs from the PHP file than the YAML files...
Marie Manandise
CC BY-SA 4.0
2021-05-11T00:00:58.750Z
2021-05-11T00:00:58.750Z
crawf
<p>I'm using the comments plugin (<a href="https://plugins.craftcms.com/comments" rel="nofollow noreferrer">https://plugins.craftcms.com/comments</a>)</p>
<p>I'd like to define the 'permissions' settings via the <code>config/comments.php</code> file but can't find docs on the syntax to use.</p>
<p>The default reads</p>
<pre><code>    // Permissions
   'permissions' =&gt; [],
</code></pre>
<p>which doesn't give me much to go on.</p>
<p>Could someone please provide an example I could work out the correct syntax from?</p>
<p>Many thanks!</p>

<comments>
Syntax for permissions in comments.php config file (comments plugin by Verbb)
# Syntax for permissions in comments.php config file (comments plugin by Verbb)

(Asked by: username_0 on 2021-05-10)

I'm using the comments plugin (https://plugins.craftcms.com/comments)
I'd like to define the 'permissions' settings via the config/comments.php file but can't find docs on the syntax to use.
The default reads
    // Permissions
   'permissions' => [],

which doesn't give me much to go on.
Could someone please provide an example I could work out the correct syntax from?
Many thanks!

**Tags:** comments

---

## 1 answers

### Answer by username_1 on 2021-05-11. Score: 1

I've just updated the docs, but because it uses the UID of element "groups" it might be annoying in practice to use the config file to set this up, as it requires a bit of manual looking-up of these values.
As the plugin settings are stored in Project Config, you'll probably get the same value setting it through the control panel.
'permissions' => [
    'craft\elements\Asset' => [
        // Volume UIDs
        '33974e79-b3b6-47ec-af91-4519fe4985be',
        'c194716f-aa74-40b6-8426-c835599cbe93',
    ],

    'craft\elements\Category' => [
        // Category Group UIDs
        'a27827c8-4810-433c-acb9-261b53d46281',
        '346194f0-6da8-4f46-a20b-795631ee9a5f',
    ],

    'craft\elements\Entry' => [
        // Section UIDs
        'a8d4bdf1-164e-4ddc-aaad-640026b8d3bf',
    ],

    'craft\elements\User' => [
        // User Group UIDs
        'c23a4d8d-47f0-4e71-927c-d5897ec9c9f8',
    ],
],

> **Comments:**
> **username_0**: Thanks @crawf! Relying on project config makes sense. We like the idea of using the PHP config file though. We are disabling admin setting changes outside local environments (i.e. no UI for comments settings in staging or prod) and think it's easier for devs to lookup configs from the PHP file than the YAML files...  

---

