code: protected function prepareForPresentation()
      {
          if ($this->prepared) {
              return;
          }
  
          $this->permissionGroups       = new Collection;
          $this->ungroupedPermissions   = [];
          $this->groupedPermissionIndex = [];
  
          $this->loadPermissionsFromModules()
               ->loadCustomPermissions()
               ->loadCustomPermissionGroups()
               ->addUngroupedPermissionGroup()
               ->filterEmptyGroups();
      }
docs: Prepares CMS data for presentation in the menu views.