system/modules/DocumentManagementSystem/modules/ModuleDmsManagement.php
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;
  }
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;
  }
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 ; }
Apply the access permissions to the categories.

@param  arr  $arrCategories  The structured array of categories.
@return  array  Returns a reduced array of categories (depends on the access permissions).
Apply the access permissions to the categories .