使用drush分配用户角色

时间:2020-08-27 14:38:48

标签: php drupal-7 drush

我正在尝试使用drush将用户角色“内容作者”分配给drupal7网站上的用户,但是出现此错误。

drush @mysite.com urol 'content author' --uid=15
Could not find a uid for the search term 'author'!                   [error]
There is no role named: content                                      [error]

我曾尝试使用相同的drush命令为该用户分配“管理员”角色,但此方法工作正常,但是,其名称包含两个单词的任何其他角色均不起作用。查看角色列表,我可以看到;

+-----+--------------------+--------+
| rid | name               | weight |
+-----+--------------------+--------+
|   3 | administrator      |      2 |
|   1 | anonymous user     |      0 |
|   2 | authenticated user |      1 |
|   4 | content author     |      3 |
|   5 | forum moderator    |      4 |
+-----+--------------------+--------+

我知道使用drush命令分配角色时应使用计算机名称,但是在引用role表的记录时,没有给角色指定任何其他名称。我也尝试过“ content_author”,“ content-author”,但是没有运气。有人可以帮我解决这个问题。谢谢!

0 个答案:

没有答案