private function applyAccessPermissionsToCategories(Array $arrCategories)
  {
    $arrSecureCategories = $arrCategories;
    foreach ($arrSecureCategories as $category)
    {
      if (!$category->isPublished() || ($this->dmsHideLockedCategories && (!$category->isUploadableForCurrentMember() && !$category->isManageableForCurrentMember())))
      {
        unset($arrSecureCategories[$category->id]);
      }
      else if ($category->hasSubCategories())
      {
        $arrSecureSubCategories = $this->applyAccessPermissionsToCategories($category->subCategories);
        $category->subCategories = $arrSecureSubCategories;
      }
    }
    return $arrSecureCategories;
  }