如何查找Drupal指定权限的名称以用于Drush角色赋权命令
Drupal Drush角色权限赋值问题解答
- “Article: create new content”权限对应的Drush可识别的机器名为
create article content,完整可执行命令如下:
drush role-add-perm 'test-role' 'create article content'
- Drupal核心默认的内容类型创建权限机器名规则为
create [内容类型机器名] content,默认Article内容类型的机器名为article,如果你的站点对Article的机器名做过自定义修改,替换命令中对应的article字段即可。 - 若要确认站点内所有权限的准确机器名,可执行以下命令输出全量权限的显示名称和对应机器名,搜索匹配即可:
# Drush 8及更早版本 drush perm-list # Drush 9及更新版本 drush permission:list
内容的提问来源于stack exchange,提问作者Reddy Rohit
相关产品推荐
相关产品推荐

