Drupal 8 中的权限表在哪里?

yll*_*h12 2 drupal-8

我搜索为数据库中所有用户定义的权限。我知道在 Drupal 7 中它位于 role_permission 表中。在 Drupal 8 中哪里可以找到它?

Art*_*ngh 5

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\n
select * from config where name = \'user.role.subadmin\';\n
Run Code Online (Sandbox Code Playgroud)\n\n

其中 subadmin 是角色名称。您将看到一个 blob 数据,其中具有该角色的序列化值。所有权限都存储在其中。

\n\n

由于这是一个配置,因此在conf文件夹中有一个.yml文件以及名称“user.role.{your_role_name}.yml”。就我而言:

\n\n
sites\xe2\x81\xa9/default\xe2\x81\xa9/\xe2\x81\xa8config\xe2\x81\xa9/\xe2\x81\xa8sync/user.role.subadmin.yml\xe2\x81\xa9\n
Run Code Online (Sandbox Code Playgroud)\n