我搜索为数据库中所有用户定义的权限。我知道在 Drupal 7 中它位于 role_permission 表中。在 Drupal 8 中哪里可以找到它?
In Drupal 8, all roles and permission stores as configuration. If you want to see it in the Database, you can check the config table.
\n\n你的查询应该是这样的:
\n\nselect * from config where name = \'user.role.subadmin\';\nRun Code Online (Sandbox Code Playgroud)\n\n其中 subadmin 是角色名称。您将看到一个 blob 数据,其中具有该角色的序列化值。所有权限都存储在其中。
\n\n由于这是一个配置,因此在conf文件夹中有一个.yml文件以及名称“user.role.{your_role_name}.yml”。就我而言:
\n\nsites\xe2\x81\xa9/default\xe2\x81\xa9/\xe2\x81\xa8config\xe2\x81\xa9/\xe2\x81\xa8sync/user.role.subadmin.yml\xe2\x81\xa9\nRun Code Online (Sandbox Code Playgroud)\n