7

I would like to manage user permissions with Drush, but I don't find any command on the official documentation website.

How to achieve this?

I am using Drupal 6, and Drush 6.0-dev.

  • Drush is not supposed to do that. Its a site builder/developer tool. – niksmac Jan 28 '13 at 11:41
9

Try this command:

drush role-add-perm 'user-role' 'permission'
4

You can install the Permissions API

The permissions_api module provides a method for granting and revoking permissions for a given role. This module helps with the issue of staging a Drupal site across multiple environments, from development sandbox to production environment.

...

Version 6.x-2.9 adds support for Drush!

  • ok i install the api permissions module, then where can i found commands ? i don't know how to see help in drush.. – webmaster pf Jan 28 '13 at 13:24
1

permissions_api will work for your purposes, but as of yet it has no 7.x version. For those who want a solution that works with both Drupal 6 and Drupal 7, Drush v6.0-dev has commands to manage roles and permissions built in. See drush help and this previous answer: Creating a new user role with Drush

Regarding finding the commands available in a module that has Drush support, use drush help --filter, and Drush will show the available command groupings. Select the module you are interested in, and all of the Drush commands it supports will be displayed. If you are having trouble getting Drush to recognize a new commandfile, try drush cc drush to clear the Drush command cache. Drush will do this automatically when a new module is downloaded and enabled, but you may need to do it manually if you copy in a Drush commandfile by hand.

1

have you tried ?

 drush php-eval 'node_access_rebuild();'
  • no,but i will when need appear – webmaster pf Nov 14 '14 at 8:07

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.