/**
  * Sort out protected archives
  * @param array
  * @return array
  */
 protected function sortOutProtected($arrCategories)
 {
     if (BE_USER_LOGGED_IN || !is_array($arrCategories) || empty($arrCategories)) {
         return $arrCategories;
     }
     $this->import('FrontendUser', 'User');
     $objCategory = \PhotogalleryModel::findMultipleByIds($arrCategories);
     $arrCategories = array();
     if ($objCategory !== null) {
         while ($objCategory->next()) {
             if ($objCategory->protected) {
                 if (!FE_USER_LOGGED_IN) {
                     continue;
                 }
                 $groups = deserialize($objCategory->groups);
                 if (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups))) {
                     continue;
                 }
             }
             $arrCategories[] = $objCategory->id;
         }
     }
     return $arrCategories;
 }