How to get user permissions for the role Administrator?
See the Role::getPermissions() method code:

  /**
   * Returns a list of permissions assigned to the role.
   *
   * @return array
   *   The permissions assigned to the role.
   */
  public function getPermissions() {
    if ($this-&gt;isAdmin()) {
      return [];
    }
    return $this-&gt;permissions;
  }


So, if the user has all permissions the returned value is an empty array.

Why? I really don't know and I can't find the answer, maybe other user knows Why Role::getPermissions() method return an empty array for admin users?.

The good news is that you can get all the Administrator permission with this code:

array_keys(\Drupal::service('user.permissions')-&gt;getPermissions());


Test this code (You'll need the Devel module to use dpm()):

$administrator = Role::load('administrator');
if($administrator-&gt;isAdmin()) {
  dpm(array_keys(\Drupal::service('user.permissions')-&gt;getPermissions()));
}