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!


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

    'craft\elements\Category' => [
        // Category Group UIDs

    'craft\elements\Entry' => [
        // Section UIDs

    'craft\elements\User' => [
        // User Group UIDs
  • 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... May 17 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.