drush

What is the syntax for Drush 12 listing of permissions for specific role


Upgrading to Drupal 10 and I am now using Drush 12.

In Drush 8, If I wanted to see what permissions a particular role had, I just ran drush @my_alias role:list 'role'

With Drush 12, if I use drush @my_alias role:list I get a list of all the roles and their associated permissions - all good.

Looking at the documentation, you now need to use the --filter option. If I want to get the permissions of just a single role, the syntax is according to the documenation is drush @my_alias role:list --filter='rid=my_role'. This syntax is returning no results i.e. { }

Testing by running drush @my_alias role:list --filter='rid=anonymous' i.e. exactly as per the documentation Drush 12 Docs I still get an empty result.

I have tried several combinations using filter, but cannot get anything other than a blank array { }

Individual permissions seem to work fine e.g. drush @my_alais role:list --filter='administer nodes'

What am I doing wrong?!


Solution

  • This has just been fixed. It will be in whatever release comes after 12.2.0.

    But since a role's permissions is just config you can also make use of config:get here:

    drush cget user.role.my_role permissions