Search code examples
drupaldrupal-8drush

How can I find out the name of a particular permission?


I'm trying to give permission to a role on my Drupal site by using the Drush command.

The permission to "Article: create new content" should be given to the test-role role.

drush role-add-perm 'test-role' '#####'

I'm not able to figure out what to write in the #### field.

How do I write "Article: create new content" in the Drush command?


Solution

  • You can use Devel to get the machine name of the permission you want. Enable "Display machine names of permissions and modules" in Devel settings and the permission machine name will show when you hover on it in the permissions page. Each content type has a different permission so you will need to get the specific one you want.