Example #1
0
 private function getUgroupIdsPermissions(Docman_Item $item, UGroupLiteralizer $literalizer, Project $project)
 {
     $ugroups_ids = $literalizer->getUgroupIds($item->getId(), self::PERMISSIONS_TYPE);
     $parent_item = $this->getParentItem($item, $project);
     if ($parent_item) {
         $parent_ugroups_ids = $this->getUgroupIdsPermissions($parent_item, $literalizer, $project);
         $ugroups_ids = $this->mergeUgroupIds($parent_ugroups_ids, $ugroups_ids);
     }
     return array_values($ugroups_ids);
 }
 private function getUgroupIdsPermissions(Docman_Item $item, UGroupLiteralizer $literalizer, Project $project)
 {
     $ugroups_ids = $literalizer->getUgroupIds($project, $item->getId(), self::PERMISSIONS_TYPE);
     if (empty($ugroups_ids)) {
         $ugroups_ids = PermissionsManager::instance()->getAuthorizedUgroupIds($project->getID(), 'PLUGIN_DOCMAN_ADMIN');
     }
     $parent_item = $this->getParentItem($item, $project);
     if ($parent_item) {
         $parent_ugroups_ids = $this->getUgroupIdsPermissions($parent_item, $literalizer, $project);
         $ugroups_ids = $this->mergeUgroupIds($parent_ugroups_ids, $ugroups_ids);
     }
     return array_values($ugroups_ids);
 }